@openchambery/web 1.19.7-beta.11 → 1.19.7-beta.13

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 (120) hide show
  1. package/dist/assets/{AgentAvatar-Di8F4QJh.js → AgentAvatar-Dp_hbVcD.js} +1 -1
  2. package/dist/assets/AssistantView-CQHey6je.js +1 -0
  3. package/dist/assets/{ChatContainer-DlO3RRGp.js → ChatContainer-C04WuLo8.js} +28 -28
  4. package/dist/assets/{ContextPanel-Q64Mvmgj.js → ContextPanel-BJEFzgz7.js} +14 -14
  5. package/dist/assets/DiagramView-iX3nhWaN.js +1 -0
  6. package/dist/assets/FadeInOnReveal-BWJcUp5P.js +1 -0
  7. package/dist/assets/Icon-4My8YZwt.js +1 -0
  8. package/dist/assets/MarkdownRendererImpl-tDry9J76.js +7 -0
  9. package/dist/assets/MarkstreamRendererImpl-BDVGi72n.js +1 -0
  10. package/dist/assets/MobileDetailNavigation-Dcl7Upvc.js +1 -0
  11. package/dist/assets/MobileShareBridge-BQ79cuPX.js +4 -0
  12. package/dist/assets/MobileSurface-CpAbBAQ5.js +2 -0
  13. package/dist/assets/{MultiRunWindow-CUmvJNmC.js → MultiRunWindow-CzMbzYD3.js} +1 -1
  14. package/dist/assets/OnboardingScreen-CuvjeXSo.js +1 -0
  15. package/dist/assets/OverlayScrollbar-BZB21Yp_.js +2 -0
  16. package/dist/assets/SettingsView-DRiEDi23.js +25 -0
  17. package/dist/assets/{SettingsWindow-CfJ8Wy0Q.js → SettingsWindow-DqwoBYvU.js} +1 -1
  18. package/dist/assets/TerminalView-4pFqXfvj.js +8 -0
  19. package/dist/assets/{ToolOutputDialog-0IxCuq0J.js → ToolOutputDialog-GmD4kIoH.js} +3 -3
  20. package/dist/assets/{appThemeRegistry-DkKIgrgm.js → appThemeRegistry-BlEYFhXM.js} +2 -2
  21. package/dist/assets/{button-z0GOBtWi.js → button-Or0daT9o.js} +1 -1
  22. package/dist/assets/clipboard-Bu0lpyX1.js +1 -0
  23. package/dist/assets/{collapsible-D9zJRpeB.js → collapsible-C-kzSGkq.js} +1 -1
  24. package/dist/assets/desktopHosts-BzSE0sK7.js +1 -0
  25. package/dist/assets/desktopRelayRestore-BaKjk1kQ.js +1 -0
  26. package/dist/assets/{diagram-CoEqmReY.js → diagram-D0mT3mo1.js} +1 -1
  27. package/dist/assets/{dialog-x2hirWBd.js → dialog-D21YndEx.js} +1 -1
  28. package/dist/assets/fileQueries-DFY6Kiy1.js +1 -0
  29. package/dist/assets/fileReferenceActions-3pPDAJSl.js +1 -0
  30. package/dist/assets/{gitApi-CeRlAeu_.js → gitApi-CciB055B.js} +1 -1
  31. package/dist/assets/{input-BG3VWTIF.js → input-BUsGnzwe.js} +1 -1
  32. package/dist/assets/insertionBoundaries-DcS10A9Q.js +4 -0
  33. package/dist/assets/main-Coj1Z4LN.js +29 -0
  34. package/dist/assets/main-DYFky6Uj.js +2 -0
  35. package/dist/assets/markdown-worker-wEFz5Hm_.js +3 -0
  36. package/dist/assets/markdownHeightCache-Bj707yG-.js +2 -0
  37. package/dist/assets/markdownTheme-E_Ina01F.js +2 -0
  38. package/dist/assets/miniChat-DK-d_3-7.js +2 -0
  39. package/dist/assets/mobile-8QzXy5wz.js +2 -0
  40. package/dist/assets/multirun-BFHWrDOR.js +4 -0
  41. package/dist/assets/outsideFileGrants-BB4GPvCq.js +1 -0
  42. package/dist/assets/path-utils-jGozTg9d.js +1 -0
  43. package/dist/assets/persistence-CSZp1CNB.js +3 -0
  44. package/dist/assets/platform-CenlWqxu.js +2 -0
  45. package/dist/assets/projectMeta-CEGa4Czs.js +3 -0
  46. package/dist/assets/radio-Bw11T40N.js +1 -0
  47. package/dist/assets/renderElectronMiniChatApp-_fchgm-8.js +2 -0
  48. package/dist/assets/renderMobileApp-B1j1BUXB.js +28 -0
  49. package/dist/assets/runtimeConfig-DNsnUkyp.js +2 -0
  50. package/dist/assets/runtimeEndpointReset-C-Sm4wpj.js +4 -0
  51. package/dist/assets/{shikiHighlight-D26Z8GUK.js → shikiHighlight-GaNLBDUk.js} +1 -1
  52. package/dist/assets/sortable-tabs-strip-Biow4Fqu.js +1 -0
  53. package/dist/assets/src-BGao3JmJ.css +2 -0
  54. package/dist/assets/terminalApi-CIIs9vFx.js +1 -0
  55. package/dist/assets/{tooltip-CtH61mQh.js → tooltip-BSrJYYYc.js} +1 -1
  56. package/dist/assets/url-CE_gAfNa.js +1 -0
  57. package/dist/assets/useAppFontEffects-D0UWTJui.js +7 -0
  58. package/dist/assets/useAssistantUIStore-BHacrxe_.js +1 -0
  59. package/dist/assets/useDesktopWindowControlsLayout-_5M7NHJ8.js +1 -0
  60. package/dist/assets/{useEffectiveDirectory-J-DxxWnv.js → useEffectiveDirectory-DqOLKISv.js} +1 -1
  61. package/dist/assets/useFontPreferences-BxOHKuVw.js +1 -0
  62. package/dist/assets/useMobileNavigationStore-DxH1DjU-.js +412 -0
  63. package/dist/assets/useSessionAutoCleanup-Dpp0-zw2.js +1 -0
  64. package/dist/assets/useUIStore-CqqO11ZI.js +1 -0
  65. package/dist/assets/useWorkerHighlightedLines-BaNK-wuY.js +7 -0
  66. package/dist/assets/utils-B0mQXN9L.js +1 -0
  67. package/dist/assets/{vendor-markstream-react-CwvbEg9R.js → vendor-markstream-react-C3K8YH0d.js} +4 -4
  68. package/dist/index.html +9 -11
  69. package/dist/mini-chat.html +9 -11
  70. package/dist/mobile.html +9 -11
  71. package/package.json +1 -1
  72. package/dist/assets/AssistantView-CgIVx0WK.js +0 -1
  73. package/dist/assets/DiagramView-CdlE8flr.js +0 -1
  74. package/dist/assets/FadeInOnReveal-CV2s6YN8.js +0 -1
  75. package/dist/assets/Icon-CLpn1mIz.js +0 -1
  76. package/dist/assets/MarkdownRendererImpl-DxbQ83lm.js +0 -7
  77. package/dist/assets/MarkstreamRendererImpl-BRvprELo.js +0 -1
  78. package/dist/assets/MobileDetailNavigation-DDMR6cv3.js +0 -1
  79. package/dist/assets/MobileShareBridge-DQxOVFCr.js +0 -4
  80. package/dist/assets/MobileSurface-Dl_XC-FA.js +0 -2
  81. package/dist/assets/OnboardingScreen-D6rtE7rj.js +0 -1
  82. package/dist/assets/OverlayScrollbar-DlNZho3q.js +0 -2
  83. package/dist/assets/SettingsView-DgliMZkT.js +0 -25
  84. package/dist/assets/TerminalView-BC2aKRX7.js +0 -8
  85. package/dist/assets/clipboard-D35XSwID.js +0 -1
  86. package/dist/assets/desktop-CfLlmafK.js +0 -1
  87. package/dist/assets/desktopHosts-C1Ns3DUu.js +0 -1
  88. package/dist/assets/desktopRelayRestore-8pvI_dSc.js +0 -1
  89. package/dist/assets/fileQueries-DGHZqZHc.js +0 -1
  90. package/dist/assets/insertionBoundaries-DaYvfIJ_.js +0 -4
  91. package/dist/assets/main-CJs9U3nT.js +0 -29
  92. package/dist/assets/main-G1Aq8Rb1.js +0 -2
  93. package/dist/assets/markdown-worker-y3ewaqAK.js +0 -4
  94. package/dist/assets/markdownHeightCache-CvUyZT4q.js +0 -1
  95. package/dist/assets/markdownTheme-SPe4jOwX.js +0 -2
  96. package/dist/assets/miniChat-caXjDzel.js +0 -2
  97. package/dist/assets/mobile-BIaA9j5G.js +0 -2
  98. package/dist/assets/multirun-h-VSzid2.js +0 -4
  99. package/dist/assets/persistence-w-AiX2i4.js +0 -3
  100. package/dist/assets/platform-4eCmsdol.js +0 -2
  101. package/dist/assets/projectMeta-FUTkzc-g.js +0 -3
  102. package/dist/assets/radio-BOdIrExy.js +0 -1
  103. package/dist/assets/renderElectronMiniChatApp-BMdzQ0Ia.js +0 -2
  104. package/dist/assets/renderMobileApp-CAW-bjY9.js +0 -28
  105. package/dist/assets/runtime-switch-BkpTTbEi.js +0 -1
  106. package/dist/assets/runtimeConfig-CH-lTGVj.js +0 -2
  107. package/dist/assets/runtimeEndpointReset-Cv7hp9sG.js +0 -4
  108. package/dist/assets/sortable-tabs-strip-CNDgyX0B.js +0 -1
  109. package/dist/assets/src-DZt1nWf5.css +0 -2
  110. package/dist/assets/terminalApi-CGtOtc8I.js +0 -1
  111. package/dist/assets/url-KeihbE0d.js +0 -1
  112. package/dist/assets/useAppFontEffects-UStZqP0A.js +0 -7
  113. package/dist/assets/useAssistantUIStore-I0VWrB5V.js +0 -1
  114. package/dist/assets/useDesktopWindowControlsLayout-vPm1nK0I.js +0 -1
  115. package/dist/assets/useFontPreferences-BLZ3y6mN.js +0 -1
  116. package/dist/assets/useMobileNavigationStore-BBfU6rSs.js +0 -412
  117. package/dist/assets/useSessionAutoCleanup-DsURtSbC.js +0 -1
  118. package/dist/assets/useUIStore-CNLmCoPU.js +0 -1
  119. package/dist/assets/useWorkerHighlightedLines-BV1tolmO.js +0 -7
  120. package/dist/assets/utils-CTL16t2f.js +0 -1
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{E as t,t as n}from"./useUIStore-CqqO11ZI.js";import{nt as r,rt as i}from"./vendor-base-ui-CnHfUmDN.js";import{l as a}from"./vendor-tanstack-react-query-D7pys_c9.js";import{r as o}from"./vendor-sonner-DVzioF3d.js";import{n as s}from"./clipboard-Bu0lpyX1.js";import{n as c}from"./Icon-4My8YZwt.js";import{n as l}from"./useRuntimeAPIs-DSLXJybW.js";import{n as u}from"./useEffectiveDirectory-DqOLKISv.js";import{t as d}from"./diagram-D0mT3mo1.js";import{n as f,r as p,t as m}from"./fileQueries-DFY6Kiy1.js";var h=e(i(),1),g=r();function _(){let{t:e}=s(),{files:r}=l(),i=a(),_=u()??null,v=t(),[y,b]=h.useState(null),[x,S]=h.useState(``),C=h.useRef(null),w=h.useRef(!1),T=h.useRef(null),E=h.useRef(0),D=h.useRef(Promise.resolve()),O=n(e=>e.pendingDiagramFile),k=p({scopeDirectory:_,path:y},{enabled:!!y});if(y&&(T.current?.path!==y||T.current.transport!==v||T.current.scopeDirectory!==_)){let e=E.current+1;E.current=e,T.current={path:y,generation:e,transport:v,scopeDirectory:_}}h.useEffect(()=>(w.current=!0,()=>{w.current=!1,E.current+=1}),[]),h.useEffect(()=>{if(!O)return;let e=n.getState().consumePendingDiagramFile();if(e){let t=E.current+1;E.current=t,T.current={path:e,generation:t,transport:v,scopeDirectory:_},b(e)}},[_,O,v]),h.useEffect(()=>{let e=T.current;if(!(!e||e.path!==y||e.transport!==v||e.scopeDirectory!==_)){if(k.data!==void 0){S(k.data);return}k.isError&&S(``)}},[_,y,k.data,k.isError,v]);let A=h.useCallback(async()=>{let t=C.current?.getXml(),n=T.current,a=r?.writeFile;if(!y||!a||!t||t===x||n?.path!==y)return;let{path:s,generation:c,scopeDirectory:l,transport:u}=n,d=D.current.then(async()=>{try{if(!(await a(s,t))?.success)throw Error(e(`filesView.toast.writeFileFailed`));let n={scopeDirectory:l,path:s};await i.cancelQueries({queryKey:m(n,u),exact:!0}),f(i,n,u,t);let r=T.current;w.current&&r?.path===s&&r.generation===c&&r.transport===u&&r.scopeDirectory===l&&S(t)}catch(t){o.error(t instanceof Error?t.message:e(`filesView.toast.saveFailed`))}});D.current=d.catch(()=>void 0),await d},[y,r,i,e,x]),j=y?y.split(`/`).pop()||y:``;return y?k.isPending?(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-3`,children:(0,g.jsx)(c,{name:`loader-4`,className:`size-4 animate-spin`})}):(0,g.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/30 px-3 py-1.5`,children:[(0,g.jsx)(c,{name:`file`,className:`size-4 shrink-0 text-muted-foreground`}),(0,g.jsx)(`span`,{className:`typography-ui text-muted-foreground truncate flex-1`,children:j}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>void A(),className:`size-6 flex items-center justify-center rounded-md text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,title:e(`filesView.diagram.saveDiagram`),children:(0,g.jsx)(c,{name:`save-3`,className:`size-4`})}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>n.getState().setActiveMainTab(`chat`),className:`size-6 flex items-center justify-center rounded-md text-muted-foreground hover:bg-interactive-hover/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,title:e(`filesView.diagram.closeDiagramView`),children:(0,g.jsx)(c,{name:`close`,className:`size-4`})})]}),(0,g.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,g.jsx)(d,{ref:C,xml:x,className:`h-full`})})]}):(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-3`,children:(0,g.jsx)(`div`,{className:`typography-ui text-muted-foreground`,children:e(`filesView.editor.pickFileFromTree`)})})}export{_ as DiagramView};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{n as r}from"./vendor-react-DLPElpoQ.js";import{t as i}from"./utils-B0mQXN9L.js";var a=500,o=12,s=(e={})=>{let t=e.delayMs??a,n=(e.moveThresholdPx??o)**2,r=e.schedule??((e,t)=>setTimeout(e,t)),i=e.clear??(e=>clearTimeout(e)),s=null,c=null,l=(t=!1)=>{s&&(i(s.timer),s=null,t||e.onPressedKeyChange?.(null))};return{start:({pointerId:n,key:i,clientX:a,clientY:o,onTrigger:u})=>{l(),e.onPressedKeyChange?.(i),s={pointerId:n,key:i,startX:a,startY:o,timer:r(()=>{!s||s.pointerId!==n||s.key!==i||(s.triggered=!0,c=i,u())},t),triggered:!1}},move:(e,t,r)=>{if(s?.pointerId!==e||s.triggered)return;let i=t-s.startX,a=r-s.startY;i*i+a*a>n&&l()},end:e=>{s?.pointerId===e&&l(s.triggered)},cancel:e=>{s?.pointerId===e&&l()},openFromContextMenu:(t,n)=>{l(),c=t,e.onPressedKeyChange?.(t),n()},consumeClick:e=>c===e&&(c=null,!0),reset:()=>{l(),c=null,e.onPressedKeyChange?.(null)}}},c=`#openchamber-skill:`,l=`#openchamber-agent:`,u=e=>`https://opencode.ai/docs/agents/#${encodeURIComponent(e)}`,d=e=>`${c}${encodeURIComponent(e)}`,f=e=>`${l}${encodeURIComponent(e)}`,p=e=>{if(!e?.startsWith(c))return null;try{return decodeURIComponent(e.slice(19))}catch{return null}},m=e=>{if(!e?.startsWith(l))return null;try{return decodeURIComponent(e.slice(19))}catch{return null}},h=[`user-blocking`,`visible`,`background`],g=e=>{let t={"user-blocking":{head:null,tail:null},visible:{head:null,tail:null},background:{head:null,tail:null}},n=Math.max(1,Math.floor(e.maxTasksPerFrame)),r=Math.max(1,e.frameBudgetMs),i=null,a=!1,o=0,s=e=>{let n=t[e.priority];e.previous=n.tail,n.tail?n.tail.next=e:n.head=e,n.tail=e},c=e=>{let n=t[e.priority];e.previous?e.previous.next=e.next:n.head=e.next,e.next?e.next.previous=e.previous:n.tail=e.previous,e.next=null,e.previous=null},l=()=>{for(let e of h){let n=t[e].head;if(n)return c(n),n.consumed=!0,--o,n}return null},u=()=>{i===null&&o!==0&&(i=e.requestFrame(d))},d=()=>{i=null;let t=e.now(),a=0;for(;o>0&&a<n;){let n=l();if(!n||(n.run(),a+=1,e.now()-t>=r))break}u()},f=()=>{i!==null||a||o===0||(a=!0,i=e.requestFrame(()=>{i=null,a=!1,u()}))};return{enqueue(t,n){let r={cancelled:!1,consumed:!1,next:null,previous:null,priority:n?.priority??`background`,run:t};return s(r),o+=1,!a&&i===null&&f(),()=>{r.cancelled||r.consumed||(r.cancelled=!0,c(r),--o,o===0&&(i!==null&&(e.cancelFrame(i),i=null),a=!1))}},clear(){for(let e of h){let n=t[e],r=n.head;for(;r;){let e=r.next;r.cancelled=!0,r.next=null,r.previous=null,r=e}n.head=null,n.tail=null}o=0,i!==null&&(e.cancelFrame(i),i=null),a=!1}}},_=null,v=()=>typeof window>`u`?null:_||(_=g({requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),now:()=>performance.now(),maxTasksPerFrame:2,frameBudgetMs:6}),_),y=(e,t)=>{let n=v();return n?n.enqueue(e,t):(e(),()=>{})},b={textThrottleMs:20,markdownPaceMs:64},x={textThrottleMs:100,markdownPaceMs:128},S=e=>e===`android`?x:b,C=r(),w=e(n(),1),T=t(),E=w.createContext(!1),D=e=>{let t=(0,C.c)(3),{disabled:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,T.jsx)(E.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i},O=e=>{let t=(0,C.c)(8),{children:n,className:r}=e,[a,o]=w.useState(!1),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=null,t=()=>o(!0);return typeof window<`u`&&typeof window.requestAnimationFrame==`function`?e=window.requestAnimationFrame(t):t(),()=>{e!==null&&typeof window<`u`&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(e)}},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),w.useEffect(s,c);let l=a?`opacity-100 translate-y-0`:`opacity-0 translate-y-2`,u;t[2]!==r||t[3]!==l?(u=i(`w-full transition-all duration-300 ease-out`,l,r),t[2]=r,t[3]=l,t[4]=u):u=t[4];let d;return t[5]!==n||t[6]!==u?(d=(0,T.jsx)(`div`,{className:u,children:n}),t[5]=n,t[6]=u,t[7]=d):d=t[7],d},k=e=>{let t=(0,C.c)(5),{children:n,className:r,skipAnimation:i,forceAnimation:a,ignoreContextDisabled:o,respectReducedMotion:s}=e,c=a!==void 0&&a,l=o!==void 0&&o,u=s!==void 0&&s,d=w.useContext(E),f=u&&typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!c||i||!l&&d||f){let e;return t[0]===n?e=t[1]:(e=(0,T.jsx)(T.Fragment,{children:n}),t[0]=n,t[1]=e),e}let p;return t[2]!==n||t[3]!==r?(p=(0,T.jsx)(O,{className:r,children:n}),t[2]=n,t[3]=r,t[4]=p):p=t[4],p};export{f as a,m as c,y as i,p as l,k as n,u as o,S as r,d as s,D as t,s as u};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{t as r}from"./utils-B0mQXN9L.js";var i=e(n(),1),a={add:`<path d="M5 12h14" /> <path d="M12 5v14" />`,"add-circle":`<circle cx="12" cy="12" r="10" /> <path d="M8 12h8" /> <path d="M12 8v8" />`,"ai-agent":`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,"ai-agent-fill":`<path d="M12 8V4H8" fill="currentColor"/> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" fill="currentColor"/> <path d="M20 14h2" fill="currentColor"/> <path d="M15 13v2" fill="currentColor"/> <path d="M9 13v2" fill="currentColor"/>`,"ai-generate-2":`<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72" /> <path d="m14 7 3 3" /> <path d="M5 6v4" /> <path d="M19 14v4" /> <path d="M10 2v2" /> <path d="M7 8H3" /> <path d="M21 16h-4" /> <path d="M11 3H9" />`,alert:`<circle cx="12" cy="12" r="10" /> <line x1="12" x2="12" y1="8" y2="12" /> <line x1="12" x2="12.01" y1="16" y2="16" />`,"alert-fill":`<path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z" fill="currentColor"/>`,"align-justify":`<path d="M3 5h18" /> <path d="M3 12h18" /> <path d="M3 19h18" />`,apple:`<path d="M12 6.528V3a1 1 0 0 1 1-1h0" /> <path d="M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21" />`,"apps-2-ai":`<rect width="7" height="7" x="3" y="3" rx="1" /> <rect width="7" height="7" x="14" y="3" rx="1" /> <rect width="7" height="7" x="14" y="14" rx="1" /> <rect width="7" height="7" x="3" y="14" rx="1" />`,archive:`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"archive-stack":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"arrow-down":`<path d="M12 5v14" /> <path d="m19 12-7 7-7-7" />`,"arrow-down-s":`<path d="m6 9 6 6 6-6" />`,"arrow-go-back":`<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 0 11H12" />`,"arrow-go-forward":`<path d="m15 14 5-5-5-5" /> <path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />`,"arrow-left":`<path d="m12 19-7-7 7-7" /> <path d="M19 12H5" />`,"arrow-left-long":`<path d="m12 19-7-7 7-7" /> <path d="M19 12H5" />`,"arrow-left-right":`<path d="M8 7H3v5" /><path d="m3 7 7 7" /><path d="M16 17h5v-5" /><path d="m21 17-7-7" />`,"arrow-left-s":`<path d="m15 18-6-6 6-6" />`,"arrow-right":`<path d="M5 12h14" /> <path d="m12 5 7 7-7 7" />`,"arrow-right-s":`<path d="m9 18 6-6-6-6" />`,"arrow-up":`<path d="m5 12 7-7 7 7" /> <path d="M12 19V5" />`,"arrow-up-double":`<path d="m17 11-5-5-5 5" /> <path d="m17 18-5-5-5 5" />`,"arrow-up-s":`<path d="m18 15-6-6-6 6" />`,"attachment-2":`<path d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" />`,"bar-chart-2":`<path d="M3 3v16a2 2 0 0 0 2 2h16" /> <path d="M18 17V9" /> <path d="M13 17V5" /> <path d="M8 17v-3" />`,"bar-chart-box":`<path d="M3 3v16a2 2 0 0 0 2 2h16" /> <path d="M18 17V9" /> <path d="M13 17V5" /> <path d="M8 17v-3" />`,book:`<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />`,"book-open":`<path d="M12 7v14" /> <path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />`,booklet:`<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />`,brain:`<path d="M12 18V5" /> <path d="M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" /> <path d="M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" /> <path d="M17.997 5.125a4 4 0 0 1 2.526 5.77" /> <path d="M18 18a4 4 0 0 0 2-7.464" /> <path d="M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" /> <path d="M6 18a4 4 0 0 1-2-7.464" /> <path d="M6.003 5.125a4 4 0 0 0-2.526 5.77" />`,"brain-ai-3":`<path d="M12 18V5" /> <path d="M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" /> <path d="M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" /> <path d="M17.997 5.125a4 4 0 0 1 2.526 5.77" /> <path d="M18 18a4 4 0 0 0 2-7.464" /> <path d="M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" /> <path d="M6 18a4 4 0 0 1-2-7.464" /> <path d="M6.003 5.125a4 4 0 0 0-2.526 5.77" />`,briefcase:`<path d="M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16" /> <rect width="20" height="14" x="2" y="6" rx="2" />`,bug:`<path d="M12 20v-9" /> <path d="M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" /> <path d="M14.12 3.88 16 2" /> <path d="M21 21a4 4 0 0 0-3.81-4" /> <path d="M21 5a4 4 0 0 1-3.55 3.97" /> <path d="M22 13h-4" /> <path d="M3 21a4 4 0 0 1 3.81-4" /> <path d="M3 5a4 4 0 0 0 3.55 3.97" /> <path d="M6 13H2" /> <path d="m8 2 1.88 1.88" /> <path d="M9 7.13V6a3 3 0 1 1 6 0v1.13" />`,calendar:`<path d="M8 2v4" /> <path d="M16 2v4" /> <rect width="18" height="18" x="3" y="4" rx="2" /> <path d="M3 10h18" />`,"calendar-schedule":`<path d="M16 14v2.2l1.6 1" /> <path d="M16 2v4" /> <path d="M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5" /> <path d="M3 10h5" /> <path d="M8 2v4" /> <circle cx="16" cy="16" r="6" />`,camera:`<path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" /> <circle cx="12" cy="13" r="3" />`,"chat-1":`<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />`,"chat-3":`<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />`,"chat-4":`<path d="M12 3a9 9 0 0 1 7.45 14.05L21 21l-4.05-1.55A9 9 0 1 1 12 3Z" />`,"chat-ai-3":`<path d="M12 6V2H8" /> <path d="M15 11v2" /> <path d="M2 12h2" /> <path d="M20 12h2" /> <path d="M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z" /> <path d="M9 11v2" />`,"chat-history":`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" /> <path d="M12 7v5l4 2" />`,"chat-new":`<path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" /> <path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" />`,"chat-thread":`<path d="M10.5 7C11.3 4.9 13.1 3.5 15.25 3.5c3.45 0 6.25 2.45 6.25 5.5 0 1.13-.38 2.18-1.03 3.06l.58 2.14-2.3-.75c-.4.18-.8.32-1.2.43" /><path d="M8.5 8.25c-3.6 0-6.5 2.55-6.5 5.75 0 1.21.42 2.33 1.13 3.25l-.63 2.27 2.48-.8c1.04.56 2.24.88 3.52.88 3.6 0 6.5-2.55 6.5-5.75S12.1 8.25 8.5 8.25Z" />`,check:`<path d="M20 6 9 17l-5-5" />`,checkbox:`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="m9 12 2 2 4-4" />`,"checkbox-blank":`<rect width="18" height="18" x="3" y="3" rx="2" />`,"checkbox-blank-circle-fill":`<circle cx="12" cy="12" r="10" fill="currentColor"/>`,"checkbox-circle":`<circle cx="12" cy="12" r="10" /> <path d="m9 12 2 2 4-4" />`,"checkbox-circle-fill":`<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM17.4571 9.45711L11 15.9142L6.79289 11.7071L8.20711 10.2929L11 13.0858L16.0429 8.04289L17.4571 9.45711Z" fill="currentColor"/>`,"checkbox-multiple":`<path d="m12 15 2 2 4-4" /> <rect width="14" height="14" x="8" y="8" rx="2" ry="2" /> <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`,clipboard:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1" /> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" />`,close:`<path d="M18 6 6 18" /> <path d="m6 6 12 12" />`,"close-circle":`<circle cx="12" cy="12" r="10" /> <path d="m15 9-6 6" /> <path d="m9 9 6 6" />`,cloud:`<path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" />`,"cloud-off":`<path d="M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057" /> <path d="M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78" /> <path d="m2 2 20 20" />`,code:`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,"code-ai":`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,"code-box":`<path d="m18 16 4-4-4-4" /> <path d="m6 8-4 4 4 4" /> <path d="m14.5 4-5 16" />`,"code-sslash":`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,command:`<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />`,"compass-3":`<circle cx="12" cy="12" r="10" /> <path d="m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" />`,computer:`<rect width="20" height="14" x="2" y="3" rx="2" /> <line x1="8" x2="16" y1="21" y2="21" /> <line x1="12" x2="12" y1="17" y2="21" />`,"contract-up-down":`<path d="m7 20 5-5 5 5" /> <path d="m7 4 5 5 5-5" />`,"corner-down-left":`<path d="M20 4v7a4 4 0 0 1-4 4H4" /> <path d="m9 10-5 5 5 5" />`,cursor:`<path d="M12.586 12.586 19 19" /> <path d="M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z" />`,"database-2":`<ellipse cx="12" cy="5" rx="9" ry="3" /> <path d="M3 5V19A9 3 0 0 0 21 19V5" /> <path d="M3 12A9 3 0 0 0 21 12" />`,"delete-bin":`<path d="M10 11v6" /> <path d="M14 11v6" /> <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /> <path d="M3 6h18" /> <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />`,"discord-fill":`<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" fill="currentColor"/>`,"donut-chart":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" />`,"donut-chart-fill":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" fill="currentColor"/> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" fill="currentColor"/>`,download:`<path d="M12 15V3" /> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /> <path d="m7 10 5 5 5-5" />`,"download-cloud":`<path d="M12 13v8l-4-4" /> <path d="m12 21 4-4" /> <path d="M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284" />`,"drag-move-2":`<circle cx="9" cy="12" r="1" /> <circle cx="9" cy="5" r="1" /> <circle cx="9" cy="19" r="1" /> <circle cx="15" cy="12" r="1" /> <circle cx="15" cy="5" r="1" /> <circle cx="15" cy="19" r="1" />`,draggable:`<circle cx="9" cy="12" r="1" /> <circle cx="9" cy="5" r="1" /> <circle cx="9" cy="19" r="1" /> <circle cx="15" cy="12" r="1" /> <circle cx="15" cy="5" r="1" /> <circle cx="15" cy="19" r="1" />`,earth:`<circle cx="12" cy="12" r="10" /> <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /> <path d="M2 12h20" />`,edit:`<path d="M15 5.5 18.5 9" /><path d="M4.5 19.5 5.75 14.75 15.25 5.25a2.1 2.1 0 0 1 3 0l.5.5a2.1 2.1 0 0 1 0 3L9.25 18.25Z" />`,"edit-2":`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />`,"emotion-happy":`<circle cx="12" cy="12" r="10" /> <path d="M8 14s1.5 2 4 2 4-2 4-2" /> <line x1="9" x2="9.01" y1="9" y2="9" /> <line x1="15" x2="15.01" y1="9" y2="9" />`,"equalizer-2":`<path d="M10 5H3" /> <path d="M12 19H3" /> <path d="M14 3v4" /> <path d="M16 17v4" /> <path d="M21 12h-9" /> <path d="M21 19h-5" /> <path d="M21 5h-7" /> <path d="M8 10v4" /> <path d="M8 12H3" />`,"error-warning":`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /> <path d="M12 9v4" /> <path d="M12 17h.01" />`,"error-warning-fill":`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z" fill="currentColor"/>`,"expand-up-down":`<path d="m7 15 5 5 5-5" /> <path d="m7 9 5-5 5 5" />`,"external-link":`<path d="M15 3h6v6" /> <path d="M10 14 21 3" /> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />`,eye:`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /> <circle cx="12" cy="12" r="3" />`,"eye-off":`<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" /> <path d="M14.084 14.158a3 3 0 0 1-4.242-4.242" /> <path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" /> <path d="m2 2 20 20" />`,file:`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" />`,"file-add":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M9 15h6" /> <path d="M12 18v-6" />`,"file-check":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="m9 15 2 2 4-4" />`,"file-check-fill":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" fill="currentColor"/> <path d="M14 2v5a1 1 0 0 0 1 1h5" fill="currentColor"/> <path d="m9 15 2 2 4-4" fill="currentColor"/>`,"file-code":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 12.5 8 15l2 2.5" /> <path d="m14 12.5 2 2.5-2 2.5" />`,"file-copy":`<rect width="14" height="14" x="8" y="8" rx="3.5" ry="3.5" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`,"file-copy-2":`<path d="M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8" /> <path d="M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z" /> <path d="M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1" />`,"file-download":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M12 18v-6" /> <path d="m9 15 3 3 3-3" />`,"file-edit":`<path d="M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z" />`,"file-image":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <circle cx="10" cy="12" r="2" /> <path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22" />`,"file-list-2":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-music":`<path d="M11.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.35" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M8 20v-7l3 1.474" /> <circle cx="6" cy="20" r="2" />`,"file-pdf":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-search":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <circle cx="11.5" cy="14.5" r="2.5" /> <path d="M13.3 16.3 15 18" />`,"file-text":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-transfer":`<path d="M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M2 15h10" /> <path d="m9 18 3-3-3-3" />`,"file-video":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z" />`,flashlight:`<path d="M12 13v1" /> <path d="M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z" /> <path d="M6 6h12" />`,flask:`<path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2" /> <path d="M6.453 15h11.094" /> <path d="M8.5 2h7" />`,"fold-vertical":`<path d="M12 22v-6" /> <path d="M12 8V2" /> <path d="M4 12H2" /> <path d="M10 12H8" /> <path d="M16 12h-2" /> <path d="M22 12h-2" /> <path d="m15 19-3-3-3 3" /> <path d="m15 5-3 3-3-3" />`,folder:`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-3":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-3-fill":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-6":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-add":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" /><path d="M12 11v6" /><path d="M9 14h6" />`,"folder-open":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-open-fill":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-received":`<path d="M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1" /> <path d="M2 13h10" /> <path d="m9 16 3-3-3-3" />`,folders:`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,fullscreen:`<path d="M8 3H5a2 2 0 0 0-2 2v3" /> <path d="M21 8V5a2 2 0 0 0-2-2h-3" /> <path d="M3 16v3a2 2 0 0 0 2 2h3" /> <path d="M16 21h3a2 2 0 0 0 2-2v-3" />`,"fullscreen-exit":`<path d="M8 3v3a2 2 0 0 1-2 2H3" /> <path d="M21 8h-3a2 2 0 0 1-2-2V3" /> <path d="M3 16h3a2 2 0 0 1 2 2v3" /> <path d="M16 21v-3a2 2 0 0 1 2-2h3" />`,gamepad:`<line x1="6" x2="10" y1="11" y2="11" /> <line x1="8" x2="8" y1="9" y2="13" /> <line x1="15" x2="15.01" y1="12" y2="12" /> <line x1="18" x2="18.01" y1="10" y2="10" /> <path d="M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z" />`,"git-branch":`<circle cx="18" cy="6" r="2.6" /><circle cx="6" cy="18" r="2.6" /><path d="M6 15.4V3" /><path d="M18 8.6c0 4.6-3.4 7.4-9.4 8" />`,"git-close-pull-request":`<circle cx="6" cy="6" r="3" /> <path d="M6 9v12" /> <path d="m21 3-6 6" /> <path d="m21 9-6-6" /> <path d="M18 11.5V15" /> <circle cx="18" cy="18" r="3" />`,"git-commit":`<circle cx="12" cy="12" r="3" /> <line x1="3" x2="9" y1="12" y2="12" /> <line x1="15" x2="21" y1="12" y2="12" />`,"git-merge":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M6 21V9a9 9 0 0 0 9 9" />`,"git-pr-draft":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M18 6V5" /> <path d="M18 11v-1" /> <line x1="6" x2="6" y1="9" y2="21" />`,"git-pull-request":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M13 6h3a2 2 0 0 1 2 2v7" /> <line x1="6" x2="6" y1="9" y2="21" />`,"git-repository":`<path d="M18 19a5 5 0 0 1-5-5v8" /> <path d="M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5" /> <circle cx="13" cy="12" r="2" /> <circle cx="20" cy="19" r="2" />`,github:`<path d="M5.88401 18.6533C5.58404 18.4526 5.32587 18.1975 5.0239 17.8369C4.91473 17.7065 4.47283 17.1524 4.55811 17.2583C4.09533 16.6833 3.80296 16.417 3.50156 16.3089C2.9817 16.1225 2.7114 15.5499 2.89784 15.0301C3.08428 14.5102 3.65685 14.2399 4.17672 14.4263C4.92936 14.6963 5.43847 15.1611 6.12425 16.0143C6.03025 15.8974 6.46364 16.441 6.55731 16.5529C6.74784 16.7804 6.88732 16.9182 6.99629 16.9911C7.20118 17.1283 7.58451 17.1874 8.14709 17.1311C8.17065 16.7489 8.24136 16.3783 8.34919 16.0358C5.38097 15.3104 3.70116 13.3952 3.70116 9.63971C3.70116 8.40085 4.0704 7.28393 4.75917 6.3478C4.5415 5.45392 4.57433 4.37284 5.06092 3.15636C5.1725 2.87739 5.40361 2.66338 5.69031 2.57352C5.77242 2.54973 5.81791 2.53915 5.89878 2.52673C6.70167 2.40343 7.83573 2.69705 9.31449 3.62336C10.181 3.41879 11.0885 3.315 12.0012 3.315C12.9129 3.315 13.8196 3.4186 14.6854 3.62277C16.1619 2.69 17.2986 2.39649 18.1072 2.52651C18.1919 2.54013 18.2645 2.55783 18.3249 2.57766C18.6059 2.66991 18.8316 2.88179 18.9414 3.15636C19.4279 4.37256 19.4608 5.45344 19.2433 6.3472C19.9342 7.28337 20.3012 8.39208 20.3012 9.63971C20.3012 13.3968 18.627 15.3048 15.6588 16.032C15.7837 16.447 15.8496 16.9105 15.8496 17.4121C15.8496 18.0765 15.8471 18.711 15.8424 19.4225C15.8412 19.6127 15.8397 19.8159 15.8375 20.1281C16.2129 20.2109 16.5229 20.5077 16.6031 20.9089C16.7114 21.4504 16.3602 21.9773 15.8186 22.0856C14.6794 22.3134 13.8353 21.5538 13.8353 20.5611C13.8353 20.4708 13.836 20.3417 13.8375 20.1145C13.8398 19.8015 13.8412 19.599 13.8425 19.4094C13.8471 18.7019 13.8496 18.0716 13.8496 17.4121C13.8496 16.7148 13.6664 16.2602 13.4237 16.051C12.7627 15.4812 13.0977 14.3973 13.965 14.2999C16.9314 13.9666 18.3012 12.8177 18.3012 9.63971C18.3012 8.68508 17.9893 7.89571 17.3881 7.23559C17.1301 6.95233 17.0567 6.54659 17.199 6.19087C17.3647 5.77663 17.4354 5.23384 17.2941 4.57702L17.2847 4.57968C16.7928 4.71886 16.1744 5.0198 15.4261 5.5285C15.182 5.69438 14.8772 5.74401 14.5932 5.66413C13.7729 5.43343 12.8913 5.315 12.0012 5.315C11.111 5.315 10.2294 5.43343 9.40916 5.66413C9.12662 5.74359 8.82344 5.69492 8.57997 5.53101C7.8274 5.02439 7.2056 4.72379 6.71079 4.58376C6.56735 5.23696 6.63814 5.77782 6.80336 6.19087C6.94565 6.54659 6.87219 6.95233 6.61423 7.23559C6.01715 7.8912 5.70116 8.69376 5.70116 9.63971C5.70116 12.8116 7.07225 13.9683 10.023 14.2999C10.8883 14.3971 11.2246 15.4769 10.5675 16.0482C10.3751 16.2156 10.1384 16.7802 10.1384 17.4121V20.5611C10.1384 21.5474 9.30356 22.2869 8.17878 22.09C7.63476 21.9948 7.27093 21.4766 7.36613 20.9326C7.43827 20.5204 7.75331 20.2116 8.13841 20.1276V19.1381C7.22829 19.1994 6.47656 19.0498 5.88401 18.6533Z" fill="currentColor"/>`,"github-fill":`<path d="M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z" fill="currentColor"/>`,global:`<circle cx="12" cy="12" r="10" /> <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /> <path d="M2 12h20" />`,"graduation-cap":`<path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z" /> <path d="M22 10v6" /> <path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5" />`,hammer:`<path d="m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9" /> <path d="m18 15 4-4" /> <path d="m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5" />`,heart:`<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" />`,history:`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" /> <path d="M12 7v5l4 2" />`,home:`<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" /> <path d="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />`,hourglass:`<path d="M8 3.5h8c.8 0 1.5.7 1.5 1.5 0 2.6-1.8 4.5-3.8 5.9-.4.3-.7.6-.7 1.1s.3.8.7 1.1c2 1.4 3.8 3.3 3.8 5.9 0 .8-.7 1.5-1.5 1.5H8c-.8 0-1.5-.7-1.5-1.5 0-2.6 1.8-4.5 3.8-5.9.4-.3.7-.6.7-1.1s-.3-.8-.7-1.1C8.3 9.5 6.5 7.6 6.5 5c0-.8.7-1.5 1.5-1.5z" />`,"hourglass-fill":`<path d="M5 22h14" fill="currentColor"/> <path d="M5 2h14" fill="currentColor"/> <path d="M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22" fill="currentColor"/> <path d="M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2" fill="currentColor"/>`,"image-download":`<path d="M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21" /> <path d="m14 19 3 3v-5.5" /> <path d="m17 22 3-3" /> <circle cx="9" cy="9" r="2" />`,"inbox-archive":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"inbox-unarchive":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h2" /> <path d="M20 8v11a2 2 0 0 1-2 2h-2" /> <path d="m9 15 3-3 3 3" /> <path d="M12 12v9" />`,"inbox-unarchive-fill":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h2" fill="currentColor"/> <path d="M20 8v11a2 2 0 0 1-2 2h-2" fill="currentColor"/> <path d="m9 15 3-3 3 3" fill="currentColor"/> <path d="M12 12v9" fill="currentColor"/>`,information:`<circle cx="12" cy="12" r="10" /> <path d="M12 16v-4" /> <path d="M12 8h.01" />`,"information-fill":`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 11V17H13V11H11ZM11 7V9H13V7H11Z" fill="currentColor"/>`,key:`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4" /> <path d="m21 2-9.6 9.6" /> <circle cx="7.5" cy="15.5" r="5.5" />`,"layout-column":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M12 3v18" />`,"layout-left":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M9 3v18" />`,"layout-left-rounded":`<rect width="18" height="18" x="3" y="3" rx="4" /><path d="M9.5 3v18" />`,"layout-right":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M15 3v18" />`,leaf:`<path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z" /> <path d="M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12" />`,lightbulb:`<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5" /> <path d="M9 18h6" /> <path d="M10 22h4" />`,"link-unlink-m":`<path d="m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" /> <path d="m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" /> <line x1="8" x2="8" y1="2" y2="5" /> <line x1="2" x2="5" y1="8" y2="8" /> <line x1="16" x2="16" y1="19" y2="22" /> <line x1="19" x2="22" y1="16" y2="16" />`,"list-check-2":`<path d="M13 5h8" /> <path d="M13 12h8" /> <path d="M13 19h8" /> <path d="m3 17 2 2 4-4" /> <path d="m3 7 2 2 4-4" />`,"list-check-3":`<path d="M13 5h8" /> <path d="M13 12h8" /> <path d="M13 19h8" /> <path d="m3 17 2 2 4-4" /> <rect x="3" y="4" width="6" height="6" rx="1" />`,"list-unordered":`<path d="M3 5h.01" /> <path d="M3 12h.01" /> <path d="M3 19h.01" /> <path d="M8 5h13" /> <path d="M8 12h13" /> <path d="M8 19h13" />`,loader:`<path d="M12 2v4" /> <path d="m16.2 7.8 2.9-2.9" /> <path d="M18 12h4" /> <path d="m16.2 16.2 2.9 2.9" /> <path d="M12 18v4" /> <path d="m4.9 19.1 2.9-2.9" /> <path d="M2 12h4" /> <path d="m4.9 4.9 2.9 2.9" />`,"loader-4":`<path d="M21 12a9 9 0 1 1-6.219-8.56" />`,lock:`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 10 0v4" />`,"lock-2":`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 10 0v4" />`,"lock-unlock":`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 9.9-1" />`,"loop-right-ai":`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" /> <path d="M21 3v5h-5" /> <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" /> <path d="M8 16H3v5" />`,macbook:`<path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z" /> <path d="M20.054 15.987H3.946" />`,"menu-2":`<path d="M4 5h16" /> <path d="M4 12h16" /> <path d="M4 19h16" />`,"menu-fold-2":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M9 3v18" /> <path d="m16 15-3-3 3-3" />`,"menu-search":`<path d="m21 21-4.34-4.34" /> <circle cx="11" cy="11" r="8" />`,mic:`<path d="M12 19v3" /> <path d="M19 10v2a7 7 0 0 1-14 0v-2" /> <rect x="9" y="2" width="6" height="13" rx="3" />`,more:`<circle cx="12" cy="12" r="1" /> <circle cx="19" cy="12" r="1" /> <circle cx="5" cy="12" r="1" />`,"more-2":`<circle cx="12" cy="12" r="1" /> <circle cx="19" cy="12" r="1" /> <circle cx="5" cy="12" r="1" />`,"more-2-fill":`<circle cx="12" cy="12" r="1" fill="currentColor"/> <circle cx="19" cy="12" r="1" fill="currentColor"/> <circle cx="5" cy="12" r="1" fill="currentColor"/>`,music:`<path d="M9 18V5l12-2v13" /> <circle cx="6" cy="18" r="3" /> <circle cx="18" cy="16" r="3" />`,"node-tree":`<rect x="16" y="16" width="6" height="6" rx="1" /> <rect x="2" y="16" width="6" height="6" rx="1" /> <rect x="9" y="2" width="6" height="6" rx="1" /> <path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3" /> <path d="M12 12V8" />`,"notification-3":`<path d="M10.268 21a2 2 0 0 0 3.464 0" /> <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />`,palette:`<path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z" /> <circle cx="13.5" cy="6.5" r=".5" fill="currentColor" /> <circle cx="17.5" cy="10.5" r=".5" fill="currentColor" /> <circle cx="6.5" cy="12.5" r=".5" fill="currentColor" /> <circle cx="8.5" cy="7.5" r=".5" fill="currentColor" />`,pause:`<path d="M6 5H8V19H6V5ZM16 5H18V19H16V5Z" fill="currentColor"/>`,pencil:`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" /> <path d="m15 5 4 4" />`,"pencil-ai":`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"pencil-ai-2":`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"picture-in-picture-2":`<path d="M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" /> <rect width="10" height="7" x="12" y="13" rx="2" />`,"pie-chart":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" />`,play:`<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" />`,"play-list-add":`<path d="M16 5H3" /> <path d="M11 12H3" /> <path d="M16 19H3" /> <path d="M18 9v6" /> <path d="M21 12h-6" />`,plug:`<path d="M12 22v-5" /> <path d="M15 8V2" /> <path d="M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z" /> <path d="M9 8V2" />`,"plug-2":`<path d="M12 22v-5" /> <path d="M15 8V2" /> <path d="M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z" /> <path d="M9 8V2" />`,pulse:`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" />`,pushpin:`<path d="M12 17v5" /> <path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />`,"pushpin-2":`<path d="M12 17v5" /> <path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />`,"pushpin-2-fill":`<path d="M22.3126 10.1753L20.8984 11.5895L20.1913 10.8824L15.9486 15.125L15.2415 18.6606L13.8273 20.0748L9.58466 15.8321L4.63492 20.7819L3.2207 19.3677L8.17045 14.4179L3.92781 10.1753L5.34202 8.76107L8.87756 8.05396L13.1202 3.81132L12.4131 3.10422L13.8273 1.69L22.3126 10.1753Z" fill="currentColor" />`,question:`<circle cx="12" cy="12" r="10" /> <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" /> <path d="M12 17h.01" />`,"record-circle":`<circle cx="12" cy="12" r="10" /> <circle cx="12" cy="12" r="1" />`,refresh:`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" /> <path d="M21 3v5h-5" /> <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" /> <path d="M8 16H3v5" />`,restart:`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" />`,robot:`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,"robot-2":`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,rocket:`<path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" /> <path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09" /> <path d="M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z" /> <path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05" />`,"save-3":`<path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" /> <path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7" /> <path d="M7 3v4a1 1 0 0 0 1 1h7" />`,"scales-3":`<path d="M12 3v18" /> <path d="m19 8 3 8a5 5 0 0 1-6 0zV7" /> <path d="M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1" /> <path d="m5 8 3 8a5 5 0 0 1-6 0zV7" /> <path d="M7 21h10" />`,"scan-2":`<path d="M3 7V5a2 2 0 0 1 2-2h2" /> <path d="M17 3h2a2 2 0 0 1 2 2v2" /> <path d="M21 17v2a2 2 0 0 1-2 2h-2" /> <path d="M7 21H5a2 2 0 0 1-2-2v-2" />`,scissors:`<circle cx="6" cy="6" r="3" /> <path d="M8.12 8.12 12 12" /> <path d="M20 4 8.12 15.88" /> <circle cx="6" cy="18" r="3" /> <path d="M14.8 14.8 20 20" />`,search:`<path d="m21 21-4.34-4.34" /> <circle cx="11" cy="11" r="8" />`,"search-eye":`<path d="M3 7V5a2 2 0 0 1 2-2h2" /> <path d="M17 3h2a2 2 0 0 1 2 2v2" /> <path d="M21 17v2a2 2 0 0 1-2 2h-2" /> <path d="M7 21H5a2 2 0 0 1-2-2v-2" /> <circle cx="12" cy="12" r="3" /> <path d="m16 16-1.9-1.9" />`,"send-plane":`<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z" /> <path d="m21.854 2.147-10.94 10.939" />`,"send-plane-2":`<path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" /> <path d="M6 12h16" />`,server:`<rect width="20" height="8" x="2" y="2" rx="2" ry="2" /> <rect width="20" height="8" x="2" y="14" rx="2" ry="2" /> <line x1="6" x2="6.01" y1="6" y2="6" /> <line x1="6" x2="6.01" y1="18" y2="18" />`,"settings-3":`<path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" /> <circle cx="12" cy="12" r="3" />`,"share-2":`<path d="M12 2v13" /> <path d="m16 6-4-4-4 4" /> <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8" />`,shield:`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />`,"shield-check":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /> <path d="m9 12 2 2 4-4" />`,"shield-keyhole":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />`,"shield-user":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /> <path d="M6.376 18.91a6 6 0 0 1 11.249.003" /> <circle cx="12" cy="11" r="4" />`,shuffle:`<path d="m18 14 4 4-4 4" /> <path d="m18 2 4 4-4 4" /> <path d="M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22" /> <path d="M2 6h1.972a4 4 0 0 1 3.6 2.2" /> <path d="M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45" />`,"slash-commands-2":`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,smartphone:`<rect width="14" height="20" x="5" y="2" rx="2" ry="2" /> <path d="M12 18h.01" />`,sparkling:`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"split-cells-horizontal":`<path d="M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3" /> <path d="M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3" /> <line x1="12" x2="12" y1="4" y2="20" />`,stack:`<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z" /> <path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" /> <path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />`,star:`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" />`,"star-fill":`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" fill="currentColor"/>`,"sticky-note":`<path d="M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z" /> <path d="M15 3v5a1 1 0 0 0 1 1h5" />`,stop:`<rect width="18" height="18" x="3" y="3" rx="2" />`,"stop-circle":`<circle cx="12" cy="12" r="9" /><rect x="9.25" y="9.25" width="5.5" height="5.5" rx="1.25" />`,subtract:`<path d="M5 12h14" />`,survey:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1" /> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" /> <path d="M12 11h4" /> <path d="M12 16h4" /> <path d="M8 11h.01" /> <path d="M8 16h.01" />`,target:`<circle cx="12" cy="12" r="10" /> <circle cx="12" cy="12" r="6" /> <circle cx="12" cy="12" r="2" />`,task:`<path d="M21.801 10A10 10 0 1 1 17 3.335" /> <path d="m9 11 3 3L22 4" />`,terminal:`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,"terminal-box":`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,"terminal-window":`<path d="m7 11 2-2-2-2" /> <path d="M11 13h4" /> <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />`,text:`<path d="M12 4v16" /> <path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /> <path d="M9 20h6" />`,"text-wrap":`<path d="m16 16-3 3 3 3" /> <path d="M3 12h14.5a1 1 0 0 1 0 7H13" /> <path d="M3 19h6" /> <path d="M3 5h18" />`,time:`<circle cx="12" cy="12" r="9" /><path d="M12 7v5.25l3.25 1.75" />`,timer:`<line x1="10" x2="14" y1="2" y2="2" /> <line x1="12" x2="15" y1="14" y2="11" /> <circle cx="12" cy="14" r="8" />`,tools:`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" />`,"twitter-xfill":`<path d="M17.6874 3.0625L12.6907 8.77425L8.37045 3.0625H2.11328L9.58961 12.8387L2.50378 20.9375H5.53795L11.0068 14.6886L15.7863 20.9375H21.8885L14.095 10.6342L20.7198 3.0625H17.6874ZM16.6232 19.1225L5.65436 4.78217H7.45745L18.3034 19.1225H16.6232Z" fill="currentColor"/>`,unpin:`<path d="M12 17v5" /> <path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" /> <path d="m2 2 20 20" /> <path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" />`,user:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" />`,"user-3":`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" />`,"video-chat":`<path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" /> <rect x="2" y="6" width="14" height="12" rx="2" />`,"volume-up":`<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" /> <path d="M16 9a5 5 0 0 1 0 6" /> <path d="M19.364 18.364a9 9 0 0 0 0-12.728" />`,window:`<rect x="2" y="4" width="20" height="16" rx="2" /> <path d="M10 4v4" /> <path d="M2 8h20" /> <path d="M6 4v4" />`},o=t(),s=`openchamber-icon-sprite-v2`,c=1.5,l=(()=>{let e=2166136261;for(let[t,n]of Object.entries(a)){let r=`${t}:${n};`;for(let t=0;t<r.length;t+=1)e=Math.imul(e^r.charCodeAt(t),16777619)}return(e>>>0).toString(36)})(),u=!1,d=new Set,f=null;function p(e){if(u&&d.has(e)&&f===l||typeof document>`u`)return;let t=document.body;if(!t)return;let n=document.getElementById(s);if(n){let t=new Set(Array.from(n.querySelectorAll(`symbol[id^="oc-"]`),e=>e.id.slice(3)));if(!n.innerHTML.includes(`--oc-icon-stroke`)||n.dataset.spriteSignature!==l||!t.has(e))n.remove();else{u=!0,d=t,f=l;return}}let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);r.id=s,r.setAttribute(`aria-hidden`,`true`),r.dataset.spriteSignature=l,r.style.display=`none`,r.innerHTML=Object.entries(a).map(([e,t])=>`<symbol id="oc-${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--oc-icon-stroke, ${c})" stroke-linecap="round" stroke-linejoin="round">${t}</symbol>`).join(``),t.insertBefore(r,t.firstChild),u=!0,d=new Set(Object.keys(a)),f=l}var m=i.memo(({name:e,className:t,weight:n=`regular`,style:i,...a})=>{typeof document<`u`&&p(e);let s=n===`medium`?2:c;return(0,o.jsx)(`svg`,{className:r(`oc-icon`,t),viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,stroke:`currentColor`,strokeWidth:s,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{"--oc-icon-stroke":s,...i},...a,children:(0,o.jsx)(`use`,{href:`#oc-${e}`})})});m.displayName=`Icon`;export{m as n,a as r,c as t};
@@ -0,0 +1,7 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{E as t,t as n}from"./useUIStore-CqqO11ZI.js";import{$t as r}from"./persistence-CSZp1CNB.js";import{nt as i,rt as a}from"./vendor-base-ui-CnHfUmDN.js";import{t as o}from"./platform-CenlWqxu.js";import{n as s}from"./vendor-react-DLPElpoQ.js";import{n as c}from"./vendor-katex--B5dHUyk.js";import{n as l,r as u,u as d}from"./vendor-reactuses-core-DDoDDyM9.js";import{n as f,t as p}from"./clipboard-Bu0lpyX1.js";import{Mi as m}from"./useMobileNavigationStore-DxH1DjU-.js";import{t as h}from"./utils-B0mQXN9L.js";import{t as g}from"./useThemeSystem-DMzWVJaW.js";import{c as _,f as v,h as y,n as b,o as x,r as S,s as C,t as w}from"./markdownTheme-E_Ina01F.js";import{n as T}from"./useRuntimeAPIs-DSLXJybW.js";import{a as E,i as D,n as O,r as k}from"./url-CE_gAfNa.js";import{i as A,r as j,t as ee}from"./markdownHeightCache-Bj707yG-.js";import{n as te}from"./useEffectiveDirectory-DqOLKISv.js";import{c as ne,i as M,l as N,n as re,o as P,r as ie,u as F}from"./FadeInOnReveal-BWJcUp5P.js";import{a as ae,i as oe,n as I,t as se}from"./markdown-worker-wEFz5Hm_.js";import{t as L}from"./vendor-morphdom-BbKiNDAu.js";import{n as R,t as z}from"./vendor-beautiful-mermaid-DykqIK5D.js";import{t as B}from"./vendor-dompurify-CeJNOzik.js";import{t as V}from"./vendor-marked-WVekxjAN.js";import{t as H}from"./vendor-remend-C3cXc-tf.js";import{a as ce,c as le,d as U,f as ue,i as de,l as fe,m as W,n as pe,r as me,s as he,t as ge}from"./fileReferenceActions-3pPDAJSl.js";var G=e(a(),1),_e=s(),K=`data-md-stream-fence`,q=`data-md-stream-line`,ve=`data-md-stream-src`,ye=`data-md-stream-applied`,be=(e,t)=>{let n=Math.min(e.length,t.length);for(let r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n},xe=e=>Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.hasAttribute(`data-md-stream-line`)),Se=(e,t)=>{let n=document.createElement(`span`);return n.setAttribute(q,String(t)),n.className=`line`,n.innerHTML=e,n},Ce=(e,t)=>{let n=xe(e),r=be(n.map(e=>e.innerHTML),t);if(n.length===0&&e.childNodes.length>0&&t.length>0){e.replaceChildren();for(let n=0;n<t.length;n+=1)e.appendChild(Se(t[n]??``,n));return{reused:0,replaced:0,added:t.length,removed:0}}let i=0;if(r<n.length&&r<t.length){let e=n[r];e&&(e.innerHTML=t[r]??``,e.setAttribute(q,String(r)),i=1)}let a=0;for(let e=n.length-1;e>=r+i;--e)n[e]?.remove(),a+=1;let o=0;for(let n=r+i;n<t.length;n+=1)e.appendChild(Se(t[n]??``,n)),o+=1;return{reused:r,replaced:i,added:o,removed:a}},we=e=>{if(e.includes(`data-md-stream-fence=`))return e;let t=e.toLowerCase().lastIndexOf(`<pre`);return t<0?e:`${e.slice(0,t)}${e.slice(t).replace(/<pre\b/i,`<pre ${K}="true"`)}`},Te=(e,t)=>{if(!(e instanceof HTMLElement)||!(t instanceof HTMLElement)||e.getAttribute(`data-md-stream-fence`)!==`true`||t.getAttribute(`data-md-stream-fence`)!==`true`)return!1;let n=e.tagName===`CODE`?e:e.querySelector(`code`),r=t.tagName===`CODE`?t:t.querySelector(`code`);return n instanceof HTMLElement&&r instanceof HTMLElement&&n.setAttribute(ve,r.textContent??``),!0},Ee=e=>e.getAttribute(`data-md-stream-src`)??e.textContent??``,De=e=>{let t=e.querySelectorAll(`pre[${K}="true"]`),n=[];return t.forEach(e=>{let t=e.querySelector(`code`);t instanceof HTMLElement&&n.push(t)}),n},Oe=e=>e.closest(`pre`)?.getAttribute(`data-md-lang`)||e.className.match(/language-([^\s"]+)/)?.[1]||`text`,ke=async(e,t,n)=>{if(n?.signal?.aborted)return;let r=De(e);await Promise.all(r.map(async r=>{let i=Ee(r);if(!i||n?.signal?.aborted||r.getAttribute(`data-md-stream-applied`)===i)return;let a=Oe(r);if(a===`mermaid`)return;let o=await t(i,a,n);!o||n?.signal?.aborted||!e.contains(r)||(Ce(r,o),r.setAttribute(ye,i),r.removeAttribute(ve))}))},Ae=`text`,je=/^(\d+):(\d+):(.+)$/,Me={ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,vue:`vue`,svelte:`svelte`,astro:`astro`,json:`json`,jsonc:`jsonc`,json5:`json5`,jsonl:`json`,ndjson:`json`,geojson:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`properties`,env:`dotenv`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,styl:`stylus`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,md:`markdown`,markdown:`markdown`,mdown:`markdown`,mkd:`markdown`,mdx:`mdx`,py:`python`,pyw:`python`,pyi:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,kts:`kotlin`,swift:`swift`,scala:`scala`,c:`c`,h:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,hpp:`cpp`,hh:`cpp`,m:`objective-c`,mm:`objective-cpp`,cs:`csharp`,fs:`fsharp`,fsx:`fsharp`,vb:`vb`,php:`php`,pl:`perl`,pm:`perl`,lua:`lua`,r:`r`,dart:`dart`,ex:`elixir`,exs:`elixir`,erl:`erlang`,hrl:`erlang`,hs:`haskell`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,groovy:`groovy`,jl:`julia`,ml:`ocaml`,mli:`ocaml`,zig:`zig`,nix:`nix`,sol:`solidity`,prisma:`prisma`,proto:`proto`,graphql:`graphql`,gql:`graphql`,sql:`sql`,sh:`shellscript`,bash:`shellscript`,zsh:`shellscript`,fish:`shellscript`,ps1:`powershell`,psm1:`powershell`,bat:`bat`,cmd:`bat`,tf:`terraform`,tfvars:`terraform`,hcl:`hcl`,diff:`diff`,patch:`diff`,csv:`csv`,tex:`latex`,vim:`viml`,wgsl:`wgsl`,glsl:`glsl`,wat:`wasm`,mermaid:`mermaid`,mmd:`mermaid`},Ne={dockerfile:`docker`,containerfile:`docker`,makefile:`make`,gnumakefile:`make`,"cmakelists.txt":`cmake`,gemfile:`ruby`,rakefile:`ruby`,podfile:`ruby`,".env":`dotenv`,".bashrc":`shellscript`,".zshrc":`shellscript`,".profile":`shellscript`},Pe=e=>{let t=e.split(/[\\/]/).pop()?.toLowerCase()??``;if(!t)return Ae;let n=Ne[t];if(n)return n;let r=t.lastIndexOf(`.`);return r<=0?Ae:Me[t.slice(r+1)]??Ae},Fe=e=>{let t=e?.trim()??``;if(!t)return{lang:Ae,label:Ae,reference:!1};let n=je.exec(t);if(!n){let e=t.toLowerCase();return{lang:e,label:e,reference:!1}}let[,r=``,i=``,a=``]=n,o=r===i?r:`${r}-${i}`;return{lang:Pe(a),label:`${a}:${o}`,reference:!0}},Ie=e=>e===` `||e===` `||e===`
2
+ `||e===`\r`,Le=e=>e!==void 0&&e>=`0`&&e<=`9`,Re=e=>e===`\\`||e===`^`||e===`_`||e===`{`||e===`}`||e===`=`||e===`+`||e===`*`||e===`/`||e===`-`,ze=e=>{for(let t=0;t<e.length;t+=1){let n=e[t];if(n!==void 0&&Re(n))return!0}return!1},Be=e=>{for(let t=0;t<e.length;t+=1){let n=e[t];if(n===`"`||n===`'`||Ie(n))return!0}return!1},Ve=e=>{let t=0;for(;t<e.length;){let n=e.indexOf(`$`,t);if(n<0)return;let r=e[n+1];if(r===`$`||r!==void 0&&!Ie(r))return n;t=n+1}},He=e=>{if(e[0]===`$`){if(e[1]===`$`){let t=e.indexOf(`$$`,2);return t<0?void 0:{raw:e.slice(0,t+2),text:e.slice(2,t),display:!0}}if(!(e.length<3||Ie(e[1])))for(let t=1;t<e.length;t+=1){let n=e[t];if(n===`\\`){t+=1;continue}if(n!==`$`)continue;if(e[t+1]===`$`||Ie(e[t-1]))return;if(Le(e[t+1]))continue;if(t===1)return;let r=e.slice(1,t);return Le(e[1])&&!ze(r)&&Be(r)?void 0:{raw:e.slice(0,t+1),text:r,display:!1}}}},J=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),Ue=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)},We=e=>`${Ue(e.raw)}:${e.mode}:${+!!e.highlight}`,Ge=e=>/^\[[^\]]+\]:\s+\S+/m.test(e)||/^\[\^[^\]]+\]:\s+/m.test(e),Ke=e=>{let t=e.match(/^[ \t]{0,3}(`{3,}|~{3,})/);if(!t)return!1;let n=t[1];if(!n)return!1;let r=n[0],i=n.length,a=e.trimEnd().split(`
3
+ `).at(-1)?.trim()??``;return!RegExp(`^[\\t ]{0,3}${r}{${i},}[\\t ]*$`).test(a)},qe=e=>{try{return H(e,{linkMode:`text-only`})}catch{return e}},Je=(e,t)=>{let n=t?`live`:`full`;if(Ge(e))return[{raw:e,src:qe(e),mode:n,highlight:!0}];let r;try{r=V.lexer(e)}catch{return[{raw:e,src:qe(e),mode:n,highlight:!0}]}let i=-1;for(let e=r.length-1;e>=0;--e)if(r[e]?.type!==`space`){i=e;break}if(i<0)return[{raw:e,src:qe(e),mode:n,highlight:!0}];let a=[];for(let e=0;e<r.length;e+=1){let t=r[e];if(!t||t.type===`space`)continue;let o=t.raw??``,s=e===i,c=t.type===`code`&&Ke(o);a.push({raw:o,src:c?o:qe(o),mode:s?n:`full`,highlight:!c})}return a.length===0?[{raw:e,src:qe(e),mode:n,highlight:!0}]:a},Ye=16,Xe=new Map,Ze=(e,t)=>{let n=`${+!!t}:${e}`,r=Xe.get(n);if(r)return Xe.delete(n),Xe.set(n,r),r;let i=Je(e,t);for(;Xe.size>=Ye;){let e=Xe.keys().next().value;if(typeof e!=`string`)break;Xe.delete(e)}return Xe.set(n,i),i},Qe=(e,t,n)=>{try{return c.renderToString(e,{displayMode:n,throwOnError:!1})}catch{return t}},$e=V.use({gfm:!0,breaks:!1,extensions:[{name:`inlineMath`,level:`inline`,start(e){let t=e.indexOf(`\\(`);return t<0?void 0:t},tokenizer(e){let t=/^\\\(([\s\S]+?)\\\)/.exec(e);if(t)return{type:`inlineMath`,raw:t[0],text:t[1]??``}},renderer(e){let t=e;return Qe(t.text,t.raw,!1)}},{name:`blockMath`,level:`block`,start(e){let t=e.indexOf(`\\[`);return t<0?void 0:t},tokenizer(e){let t=/^\\\[([\s\S]+?)\\\]/.exec(e);if(t)return{type:`blockMath`,raw:t[0],text:t[1]??``}},renderer(e){let t=e;return Qe(t.text,t.raw,!0)}},{name:`dollarMath`,level:`inline`,start(e){return Ve(e)},tokenizer(e){let t=He(e);if(t)return{type:`dollarMath`,raw:t.raw,text:t.text,display:t.display}},renderer(e){let t=e;return Qe(t.text,t.raw,t.display)}}],renderer:{link({href:e,title:t,text:n}){let r=e??``,i=ne(r);if(i)return`<a href="${J(P(i))}" data-openchamber-agent-mention="true" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">${n}</a>`;let a=N(r);if(a)return`<a href="${J(r)}" data-skill-name="${J(a)}" class="text-primary hover:underline">${n}</a>`;let o=t?` title="${J(t)}"`:``;return`<a href="${J(r)}"${o} class="external-link" target="_blank" rel="noopener noreferrer">${n}</a>`}}}),et=e=>e.replace(/\$\$([\s\S]*?)\$\$/g,(e,t)=>{try{return c.renderToString(t,{displayMode:!0,throwOnError:!1})}catch{return`$$${t}$$`}}),tt=e=>e.indexOf(`$`)===-1?e:e.split(/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi).map((e,t)=>t%2==1?e:et(e)).join(``),nt=e=>tt($e.parse(e)),rt=e=>{let t=nt(e.src);return e.highlight?t:we(t)},it=/<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g,at=1200,ot=(e,t)=>{let n=1;for(let r=0;r<e.length;r+=1)if(e.charCodeAt(r)===10&&++n>t)return!0;return!1},st=e=>e.replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&#39;/g,`'`).replace(/&amp;/g,`&`),ct=e=>e.reference?`data-md-lang="${J(e.lang)}" data-md-label="${J(e.label)}"`:`data-md-lang="${J(e.lang)}"`,lt=async(e,t,n)=>{if(n.isCancelled?.())return null;let r=[...e.matchAll(it)];if(r.length===0)return e;let i=e;for(let e of r){if(n.isCancelled?.())return null;let[r,a,o]=e,s=Fe(a);if(s.lang===`mermaid`&&!s.reference)continue;let c=st(o??``);if(ot(c,n.lineLimit)){i=i.replace(r,()=>r.replace(`<pre`,`<pre ${ct(s)}`));continue}let l=await t(c,s.lang);if(n.isCancelled?.())return null;if(l){let e=l.replace(/^<pre/,`<pre ${ct(s)}`);i=i.replace(r,()=>e)}}return i},ut=(e,t)=>!t&&e.length<=480&&!e.includes("```"),dt={USE_PROFILES:{html:!0,mathMl:!0,svg:!0},ADD_TAGS:[`svg`,`path`,`g`,`rect`,`line`,`polygon`,`polyline`,`circle`,`ellipse`,`text`,`tspan`,`defs`,`marker`],ADD_ATTR:[`d`,`viewBox`,`preserveAspectRatio`,`xmlns`,`target`,`fill`,`stroke`,`stroke-width`,`transform`,`points`,`x`,`y`,`x1`,`y1`,`x2`,`y2`,`cx`,`cy`,`r`,`rx`,`ry`,`style`],FORBID_TAGS:[`script`],FORBID_CONTENTS:[`script`]},ft=!1,pt=()=>{ft||typeof window>`u`||!B.isSupported||(ft=!0,B.addHook(`uponSanitizeAttribute`,(e,t)=>{if(!(e instanceof HTMLImageElement)||t.attrName!==`src`)return;let n=typeof t.attrValue==`string`?t.attrValue:``;/^file:/i.test(n)&&(e.setAttribute(`data-md-image-source`,n),t.keepAttr=!1)}),B.addHook(`afterSanitizeAttributes`,e=>{e instanceof HTMLAnchorElement&&e.target===`_blank`&&e.setAttribute(`rel`,`noopener noreferrer`)}))},mt=e=>B.isSupported?(pt(),B.sanitize(e,dt)):``,ht=`data-md-sanitize-block`,gt=e=>{if(e.length===0)return[];if(e.length===1)return[mt(e[0])];if(!B.isSupported||typeof document>`u`)return e.map(e=>mt(e));let t=e.map((e,t)=>`<div ${ht}="${t}">${e}</div>`).join(``),n=document.createElement(`div`);n.innerHTML=mt(t);let r=e.map(()=>``);return n.querySelectorAll(`[${ht}]`).forEach(e=>{let t=Number(e.getAttribute(ht));Number.isInteger(t)&&t>=0&&t<r.length&&(r[t]=e.innerHTML)}),r},_t=()=>r()?200:at,vt=240,yt=16777216,bt=160,xt=8388608,St=new A({maxEntries:vt,maxBytes:yt}),Ct=new A({maxEntries:bt,maxBytes:xt}),wt=e=>e.length*2,Tt=(e,t)=>{St.set(e,t,wt(e)+wt(t.hash)+wt(t.html))},Et=async(e,t,n)=>lt(e,(e,r)=>se(e,r,{signal:t,priority:n}),{lineLimit:_t(),isCancelled:()=>!!t?.aborted}),Dt=async(e,t,n)=>{if(t?.aborted)return null;let r=rt(e);if(t?.aborted)return null;let i=e.highlight?await Et(r,t,n):r;if(i===null||t?.aborted)return null;let a=mt(i);return t?.aborted?null:a},Ot=e=>`${Ue(e)}:${e.length}`,kt=e=>{let t=Ct.get(Ot(e));return t?.source===e?t.html:void 0},At=(e,t)=>{let n=Ot(e);Ct.set(n,{source:e,html:t},wt(n)+wt(e)+wt(t))},jt=e=>{if(!e)return[];let t=Ze(e,!1),n=Array(t.length).fill(``),r=[],i=[];t.forEach((e,t)=>{let a=kt(e.src);if(a!==void 0){n[t]=a;return}r.push(t),i.push(rt(e))});let a=gt(i);return r.forEach((e,r)=>{let i=a[r]??``;n[e]=i;let o=t[e]?.src;o!==void 0&&At(o,i)}),n},Mt=8,Nt=()=>typeof performance<`u`?performance.now():Date.now(),Pt=e=>e?.aborted?Promise.resolve(!1):new Promise(t=>{let n=!1,r=r=>{n||(n=!0,e?.removeEventListener(`abort`,a),t(r))},i=M(()=>{r(!e?.aborted)},{priority:`visible`}),a=()=>{i(),r(!1)};e?.addEventListener(`abort`,a,{once:!0})}),Ft=(e,t)=>{let n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(!i)return null;let a=Ue(i.raw),o=`${t}:${r}:${i.mode}`,s=St.get(o);if(!s||s.hash!==a)return null;n.push({id:We(i),html:s.html})}return n},It=(e,t,n)=>{let r=gt(t.map(e=>e.html));return t.map((t,i)=>{let a=e[i],o=r[i]??``;return a&&Tt(`${n}:${i}:${a.mode}`,{hash:Ue(a.raw),html:o}),{id:t.id,html:o}})},Lt=async(e,t,n,r)=>{let i=n?`visible`:`background`,a=async(e,n)=>{if(r?.aborted)return null;let a=Ue(e.raw),o=We(e),s=`${t}:${n}:${e.mode}`,c=St.get(s);if(c&&c.hash===a)return{id:o,html:c.html};let l=await Dt(e,r,i);return l===null||r?.aborted?null:(Tt(s,{hash:a,html:l}),{id:o,html:l})};if(n)return(await Promise.all(e.map(a))).filter(e=>e!==null);let o=[],s=0;for(let t=0;t<e.length&&!r?.aborted;t+=1){let n=e[t];if(!n)continue;if(Nt()>=s){if(!await Pt(r))break;s=Nt()+Mt}let i=await a(n,t);i&&o.push(i)}return o},Rt=async(e,t,n,r)=>{if(!e)return[];let i=Ze(e,t),a=Ft(i,n);if(a)return a;let o=t?`visible`:`background`,s=[],c=[];for(let e=0;e<i.length;e+=1){let t=i[e];if(!t)continue;let r=St.get(`${n}:${e}:${t.mode}`);r&&r.hash===Ue(t.raw)||(s.push(t),c.push(e))}if(!ut(e,t)&&s.length>0)try{let e=await oe({streaming:t,highlight:!0,highlightLineLimit:_t(),signal:r,priority:o,blocks:s});if(r?.aborted)return[];if(e&&e.length===s.length)return It(i,i.map((t,r)=>{let i=c.indexOf(r);if(i>=0)return e[i]??{id:We(t),html:``,highlight:t.highlight};let a=St.get(`${n}:${r}:${t.mode}`);return{id:We(t),html:a?.html??``,highlight:t.highlight}}),n)}catch{}return Lt(i,n,t,r)},Y=e=>Number.isFinite(e)&&e>0,zt=e=>{if(typeof e==`number`)return Y(e)?e:null;if(typeof e!=`string`)return null;let t=e.trim().match(/^([+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))(?:[eE][+-]?\d+)?)(?:px)?$/);if(!t)return null;let n=Number(t[1]);return Y(n)?n:null},Bt=(e,t,n)=>Math.min(n,Math.max(t,e)),Vt=6,Ht=1.25,Ut=1.0015,Wt=16,Gt=1e3,Kt=.5,qt=12,Jt=400,Yt=`[data-markdown="mermaid-block"]`,Xt=e=>e.querySelector(Yt)!==null,Zt=e=>[e.x,e.y,e.width,e.height].map(e=>{let t=Number(e.toFixed(Vt));return Object.is(t,-0)?`0`:String(t)}).join(` `),Qt=e=>{let t=e.viewBox?.trim().split(/[\s,]+/).map(e=>Number.parseFloat(e));if(t?.length===4){let[e,n,r,i]=t;if(Number.isFinite(e)&&Number.isFinite(n)&&Y(r)&&Y(i))return{x:e,y:n,width:r,height:i}}let n=zt(e.width),r=zt(e.height);return n===null||r===null?null:{x:0,y:0,width:n,height:r}},$t=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)},en=e=>{let t=e.renderMode||`unknown`,n=e.svgMarkup??``;if(!n){let n=[e.viewBox??``,e.width??``,e.height??``];return n.some(e=>e!==``)?`${t}:bounds:${n.join(`:`)}`:`${t}:no-svg`}return[t,$t(n)].join(`:`)},tn=(e,t)=>{if(!Y(t.width)||!Y(t.height))return e;let n=e.width/e.height,r=t.width/t.height;if(n>r){let t=e.width/r;return{x:e.x,y:e.y-(t-e.height)/2,width:e.width,height:t}}let i=e.height*r;return{x:e.x-(i-e.width)/2,y:e.y,width:i,height:e.height}},nn=({currentBox:e,viewport:t,delta:n})=>!Y(t.width)||!Y(t.height)||!Y(e.width)||!Y(e.height)?e:{x:e.x-n.x/t.width*e.width,y:e.y-n.y/t.height*e.height,width:e.width,height:e.height},rn=(e,t,n)=>{let r=e*(t===1?Wt:t===2?Y(n)?n:0:1);return Number.isFinite(r)?Bt(r,-1e3,Gt):0},an=e=>{let t=null;for(let n of e){if(!t){t=n;continue}return{center:{x:(t.x+n.x)/2,y:(t.y+n.y)/2},distance:Math.hypot(n.x-t.x,n.y-t.y)}}return null},on=(e,t)=>{let n=t.x-e.x,r=t.y-e.y;return n*n+r*r>9},sn=({currentBox:e,contentBox:t,viewport:n,pointer:r,zoomFactor:i,minScale:a,maxScale:o})=>{if(!Y(n.width)||!Y(n.height)||!Y(i)||!Y(e.width)||!Y(e.height)||!Y(t.width)||!Y(t.height)||!Y(a)||!Y(o))return e;let s=Math.min(a,o),c=Math.max(a,o),l=tn(t,n),u=Bt(l.width/e.width*i,s,c),d=l.width/u,f=d/(e.width/e.height),p=Bt(r.x/n.width,0,1),m=Bt(r.y/n.height,0,1),h=e.x+p*e.width,g=e.y+m*e.height;return{x:h-p*d,y:g-m*f,width:d,height:f}},cn=({currentBox:e,contentBox:t,viewport:n,previousGesture:r,gesture:i,minScale:a,maxScale:o})=>!Y(r.distance)||!Y(i.distance)?e:sn({currentBox:nn({currentBox:e,viewport:n,delta:{x:i.center.x-r.center.x,y:i.center.y-r.center.y}}),contentBox:t,viewport:n,pointer:i.center,zoomFactor:i.distance/r.distance,minScale:a,maxScale:o}),ln=new WeakMap,un=e=>e instanceof HTMLElement?ln.get(e)??null:null,dn=e=>e.querySelector(`[data-markdown="mermaid-viewport"]`)??e.querySelector(`[data-markdown="mermaid"]`),fn=e=>{let t=e.querySelector(`[data-markdown="mermaid"] svg`),n=e.querySelector(`[data-markdown="mermaid"]`);return en({renderMode:e.getAttribute(`data-mermaid-render`),svgMarkup:n?.getAttribute(`data-md-original-svg`)??t?.outerHTML??null,viewBox:t?.getAttribute(`viewBox`),width:t?.getAttribute(`width`),height:t?.getAttribute(`height`)})},pn=e=>{let t=e.getBoundingClientRect();return{width:t.width,height:t.height}},mn=(e,t)=>({x:e.clientX-t.left,y:e.clientY-t.top}),hn=(e,t)=>mn(e,t.getBoundingClientRect()),gn=e=>e instanceof Element&&!!e.closest(`button, a, [role="button"]`),_n=e=>{let t=dn(e),n=e.querySelector(`[data-markdown="mermaid"] svg`);if(!t||!n)return null;let r=Qt({viewBox:n.getAttribute(`viewBox`),width:n.getAttribute(`width`),height:n.getAttribute(`height`)});if(!r)return null;let i=r,a=null,o=null,s=null,c=new Map,l=new Set,u=null,d=null,f=e=>{i=e,n.setAttribute(`viewBox`,Zt(e)),n.removeAttribute(`width`),n.removeAttribute(`height`)},p=()=>{f(tn(r,pn(t)))},m=(e,n)=>{f(sn({currentBox:i,contentBox:r,viewport:pn(t),pointer:e,zoomFactor:n,minScale:Kt,maxScale:qt}))},h=()=>{let e=pn(t);m({x:e.width/2,y:e.height/2},Ht)},g=()=>{let e=pn(t);m({x:e.width/2,y:e.height/2},1/Ht)},_=e=>{e.preventDefault(),e.stopPropagation();let n=rn(e.deltaY,e.deltaMode,pn(t).height);m(hn(e,t),Ut**+-n)},v=e=>{try{t.setPointerCapture(e),l.add(e)}catch{}},y=e=>{if(l.delete(e))try{t.hasPointerCapture(e)&&t.releasePointerCapture(e)}catch{}},b=()=>{a=null,o=null,s=null,c.clear(),u=null},x=()=>{b(),e.removeAttribute(`data-mermaid-panning`),e.hasAttribute(`data-mermaid-suppress-click`)&&(d=window.setTimeout(()=>{e.removeAttribute(`data-mermaid-suppress-click`),d=null},Jt))},S=n=>{if(n.pointerType!==`touch`&&n.button!==0||gn(n.target))return;d!==null&&(window.clearTimeout(d),d=null),e.removeAttribute(`data-mermaid-suppress-click`);let r=hn(n,t);v(n.pointerId),e.setAttribute(`data-mermaid-panning`,`true`),n.pointerType===`touch`?(c.set(n.pointerId,r),c.size>=2?(a=null,o=null,s=null,u=an(c.values()),e.setAttribute(`data-mermaid-suppress-click`,`true`)):(a=n.pointerId,o=r,s=r)):(a=n.pointerId,o=r,s=r),n.preventDefault()},C=n=>{if(n.pointerType===`touch`){if(!c.has(n.pointerId))return;let a=hn(n,t);if(c.set(n.pointerId,a),c.size>=2){let a=an(c.values());u&&a&&f(cn({currentBox:i,contentBox:r,viewport:pn(t),previousGesture:u,gesture:a,minScale:Kt,maxScale:qt})),u=a,e.setAttribute(`data-mermaid-suppress-click`,`true`),n.preventDefault();return}}if(a!==n.pointerId||!s)return;let l=hn(n,t);f(nn({currentBox:i,viewport:pn(t),delta:{x:l.x-s.x,y:l.y-s.y}})),s=l,o&&on(o,l)&&e.setAttribute(`data-mermaid-suppress-click`,`true`),n.preventDefault()},w=e=>{if(e.pointerType===`touch`||c.has(e.pointerId)){if(!c.has(e.pointerId))return;if(c.delete(e.pointerId),u=an(c.values()),c.size>0){for(let[e,t]of c){a=e,o=t,s=t;break}c.size>=2&&(a=null,o=null,s=null),y(e.pointerId);return}x(),y(e.pointerId);return}a===e.pointerId&&(x(),y(e.pointerId))},T=()=>{p()};t.addEventListener(`wheel`,_,{passive:!1}),t.addEventListener(`pointerdown`,S),t.addEventListener(`pointermove`,C),t.addEventListener(`pointerup`,w),t.addEventListener(`pointercancel`,w),t.addEventListener(`lostpointercapture`,w),window.addEventListener(`resize`,T);let E=typeof ResizeObserver>`u`?null:new ResizeObserver(T);return E?.observe(t),p(),{zoomIn:h,zoomOut:g,fit:p,cleanup:()=>{t.removeEventListener(`wheel`,_),t.removeEventListener(`pointerdown`,S),t.removeEventListener(`pointermove`,C),t.removeEventListener(`pointerup`,w),t.removeEventListener(`pointercancel`,w),t.removeEventListener(`lostpointercapture`,w),window.removeEventListener(`resize`,T),E?.disconnect(),d!==null&&window.clearTimeout(d);for(let e of Array.from(l))y(e);b(),e.removeAttribute(`data-mermaid-panning`),e.removeAttribute(`data-mermaid-suppress-click`),ln.delete(e)}}},vn=e=>{let t=new Map,n=new Map,r=()=>{for(let[r,i]of Array.from(t.entries())){let a=fn(r);(!e.contains(r)||a!==n.get(r))&&(i.cleanup(),t.delete(r),n.delete(r))}for(let r of Array.from(e.querySelectorAll(Yt))){if(t.has(r)||r.querySelector(`[data-markdown="mermaid"] svg`)===null)continue;let e=_n(r);e&&(t.set(r,e),n.set(r,fn(r)),ln.set(r,e))}};return r(),{refresh:r,cleanup:()=>{for(let e of t.values())e.cleanup();t.clear(),n.clear()}}},X=(e,t=`size-3.5`)=>`<svg class="oc-icon ${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><use href="#oc-${e}"></use></svg>`,yn={copy:X(`file-copy`),check:X(`check`),download:X(`download`),zoomIn:X(`add`),zoomOut:X(`subtract`),fit:X(`refresh`),textWrap:X(`text-wrap`),image:X(`file-image`,`size-10`),imageDownload:X(`download`,`size-3`),imageLoading:X(`loader-4`,`size-3.5 animate-spin motion-reduce:animate-none`)},bn=`p-1 rounded hover:bg-interactive-hover/60 text-muted-foreground hover:text-foreground transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--interactive-focus-ring)]`,xn=(e,t)=>{e.innerHTML=t},Z=(e,t,n)=>{let r=document.createElement(`button`);return r.type=`button`,r.className=bn,r.setAttribute(`data-md-action`,n),r.setAttribute(`title`,t),r.setAttribute(`aria-label`,t),xn(r,yn[e]),r},Sn=(e,t,n)=>{let r=e.querySelector(`[data-md-code-body]`),i=e.querySelector(`pre`),a=e.querySelector(`pre code`),o=e.querySelector(`[data-md-action="toggle-code-wrap"]`);if(e.setAttribute(`data-code-wrap`,t?`true`:`false`),r?.classList.toggle(`overflow-x-auto`,!t),r?.classList.toggle(`overflow-x-hidden`,t),i?.classList.toggle(`whitespace-pre-wrap`,t),i?.classList.toggle(`break-words`,t),a?.classList.toggle(`whitespace-pre-wrap`,t),a?.classList.toggle(`break-words`,t),i&&(i.style.whiteSpace=t?`pre-wrap`:`pre`,i.style.overflowWrap=t?`anywhere`:`normal`),a&&(a.style.whiteSpace=t?`pre-wrap`:`pre`,a.style.overflowWrap=t?`anywhere`:`normal`),o){let e=t?n.disableCodeWrap:n.enableCodeWrap;o.setAttribute(`title`,e),o.setAttribute(`aria-label`,e),o.classList.toggle(`text-foreground`,t),o.classList.toggle(`opacity-100`,t),o.classList.toggle(`text-muted-foreground`,!t),o.classList.toggle(`opacity-65`,!t),o.setAttribute(`aria-pressed`,t?`true`:`false`)}},Cn=e=>{let t=document.createElement(`div`);t.setAttribute(`data-md-code-line-numbers`,``),t.setAttribute(`aria-hidden`,`true`),t.className=`min-w-8 shrink-0 select-none border-r border-border/50 pr-3 text-right font-mono text-[13px] text-muted-foreground/45`;let n=e.textContent??``,r=Math.max(1,n.endsWith(`
4
+ `)?n.split(`
5
+ `).length-1:n.split(`
6
+ `).length);for(let e=1;e<=r;e+=1){let n=document.createElement(`div`);n.className=`tabular-nums`,n.textContent=String(e),t.appendChild(n)}return t},wn=e=>{let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=n.nextNode();for(;r;)t.push(r),r=n.nextNode();return t},Tn=(e,t)=>{let n=0;for(let r of e){let e=n+r.data.length;if(t<=e)return{node:r,offset:Math.max(0,t-n)};n=e}let r=e.at(-1);return r?{node:r,offset:r.data.length}:null},En=(e,t)=>{let n=1/0,r=-1/0;for(let t=0;t<e.length;t+=1){let i=e[t];!i||i.width===0&&i.height===0||(i.top<n&&(n=i.top),i.bottom>r&&(r=i.bottom))}return!Number.isFinite(n)||r<=n?t:Math.max(t,r-n)},Dn=e=>Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.classList.contains(`line`)),On=(e,t,n)=>{e.style.height=`${t}px`,e.style.lineHeight=`${n}px`},kn=(e,t,n)=>{let r=document.createRange();r.setStart(e.node,e.offset),r.setEnd(t.node,t.offset);let i=Math.max(En(r.getClientRects(),n),En([r.getBoundingClientRect()],n));return r.detach(),i},An=e=>{let t=e.querySelectorAll(`[data-component="markdown-code"]`);for(let e of Array.from(t)){let t=e.querySelector(`pre code`),n=e.querySelector(`[data-md-code-line-numbers]`);if(!t||!n)continue;let r=Array.from(n.children),i=window.getComputedStyle(t),a=Number.parseFloat(i.lineHeight)||20;n.style.fontFamily=i.fontFamily,n.style.fontSize=i.fontSize,n.style.lineHeight=`${a}px`;let o=Dn(t);if(o.length===r.length){let e=o.map(e=>e.getBoundingClientRect()),t=e=>(e?.textContent??``).length===0;for(let n=0;n<r.length;n+=1){let i=r[n],s=o[n],c=e[n];if(!i||!s||!c)continue;if(t(s)){On(i,a,a);continue}let l=o[n+1],u=e[n+1],d=u&&!t(l)?u.top:c.bottom;On(i,En([{top:c.top,bottom:d,width:1,height:d-c.top}],a),a)}continue}let s=t.textContent??``,c=wn(t),l=0;for(let e=0;e<r.length;e+=1){let t=s.indexOf(`
7
+ `,l),n=t===-1?s.length:t,i=r[e];if(!i)continue;let o=Tn(c,l),u=Tn(c,n);!o||!u||l===n?On(i,a,a):On(i,kn(o,u,a),a),l=n+1}}},jn=e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>An(e))})},Mn=(e,t,n)=>{let r=e.querySelectorAll(`[data-component="markdown-code"]`);for(let e of Array.from(r)){let r=e.querySelector(`[data-md-code-body]`),i=e.querySelector(`pre`);r&&i&&!r.querySelector(`[data-md-code-line-numbers]`)&&(r.classList.add(`flex`,`gap-3`),r.insertBefore(Cn(i),i)),Sn(e,t,n)}jn(e)},Nn=(e,t,n,r)=>{xn(e,yn.check),e.setAttribute(`title`,t),e.setAttribute(`aria-label`,t),window.setTimeout(()=>{xn(e,yn[n]),e.setAttribute(`title`,r),e.setAttribute(`aria-label`,r)},2e3)},Pn=e=>{let t=e.querySelectorAll(`:not(pre) > code`);for(let e of Array.from(t))e.getAttribute(`data-markdown`)!==`inline-code`&&e.setAttribute(`data-markdown`,`inline-code`)},Fn=(e,t)=>{let n=e.querySelectorAll(`pre`);for(let e of Array.from(n)){if(e.querySelector(`code.language-mermaid`))continue;let n=e.parentElement;if(!n||n.closest(`[data-component="markdown-code"]`))continue;let r=e.querySelector(`code`)?.className.match(/language-([^\s"]+)/)?.[1],i=e.getAttribute(`data-md-label`)??e.getAttribute(`data-md-lang`)??Fe(r).label,a=document.createElement(`div`);a.setAttribute(`data-component`,`markdown-code`),a.className=`my-4 group overflow-hidden rounded-2xl border border-border/80 bg-[var(--surface-elevated)]`;let o=document.createElement(`div`);o.className=`flex items-center justify-between border-b border-border/70 px-3 py-1.5`;let s=document.createElement(`span`);s.className=`font-mono text-[13px] text-muted-foreground`,s.textContent=i;let c=Z(`copy`,t.labels.copy,`copy-code`),l=Z(`textWrap`,t.codeBlockLineWrap?t.labels.disableCodeWrap:t.labels.enableCodeWrap,`toggle-code-wrap`);o.appendChild(s);let u=document.createElement(`div`);u.className=`flex items-center gap-1`,u.appendChild(l),u.appendChild(c),o.appendChild(u);let d=document.createElement(`div`);d.setAttribute(`data-md-code-body`,``),d.className=`px-3 py-2.5 overflow-x-auto`,n.replaceChild(a,e),e.style.margin=`0`,e.style.background=`transparent`,e.classList.add(`min-w-0`,`w-full`,`flex-1`),d.appendChild(e),a.appendChild(o),a.appendChild(d),Sn(a,t.codeBlockLineWrap,t.labels)}},In=e=>{let t=e.querySelectorAll(`table`);for(let e of Array.from(t)){if(e.closest(`[data-markdown="table-wrapper"]`))continue;let t=document.createElement(`div`);t.className=`my-4`,t.setAttribute(`data-markdown`,`table-wrapper`);let n=document.createElement(`div`);n.setAttribute(`data-markdown`,`table-scroll`);let r=e.parentElement;if(r){r.replaceChild(t,e),e.setAttribute(`data-markdown`,`table`);for(let t of Array.from(e.querySelectorAll(`tr`)))t.setAttribute(`data-markdown`,`table-row`);for(let t of Array.from(e.querySelectorAll(`th`)))t.setAttribute(`data-markdown`,`table-header-cell`);for(let t of Array.from(e.querySelectorAll(`td`)))t.setAttribute(`data-markdown`,`table-cell`);n.appendChild(e),t.appendChild(n)}}},Ln=(e,t)=>{let n=e.querySelectorAll(`pre > code.language-mermaid`);for(let e of Array.from(n)){let n=e.parentElement;if(!n)continue;let r=(e.textContent??``).replace(/\s+$/,``),i=t.renderMermaid(r),a=document.createElement(`div`);a.setAttribute(`data-markdown`,`mermaid-block`),a.setAttribute(`data-md-source`,r),a.className=`group relative`;let o=document.createElement(`div`);o.setAttribute(`data-markdown`,`mermaid-scroll`);let s=document.createElement(`div`);if(s.setAttribute(`data-markdown`,`mermaid-toolbar`),s.className=`absolute top-1 right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity`,i.svg){a.setAttribute(`data-mermaid-render`,`svg`);let e=document.createElement(`div`);e.setAttribute(`data-markdown`,`mermaid-viewport`);let n=document.createElement(`div`);if(n.setAttribute(`data-markdown`,`mermaid`),n.setAttribute(`data-md-original-svg`,i.svg),n.innerHTML=i.svg,e.appendChild(n),o.appendChild(e),t.mermaidControls.showPanZoomControls&&(s.appendChild(Z(`zoomIn`,t.labels.zoomInDiagram,`mermaid-zoom-in`)),s.appendChild(Z(`zoomOut`,t.labels.zoomOutDiagram,`mermaid-zoom-out`)),s.appendChild(Z(`fit`,t.labels.resetDiagramView,`mermaid-fit`))),t.mermaidControls.copy){let e=Z(`copy`,t.labels.copyDiagram,`mermaid-copy`);e.setAttribute(`data-md-source`,r),s.appendChild(e)}if(t.mermaidControls.download){let e=Z(`download`,t.labels.downloadDiagram,`mermaid-download`);e.setAttribute(`data-md-svg`,`1`),s.appendChild(e)}}else{a.setAttribute(`data-mermaid-render`,`ascii`);let e=document.createElement(`pre`);if(e.setAttribute(`data-markdown`,`mermaid-ascii`),e.textContent=i.ascii||r,o.appendChild(e),t.mermaidControls.copy){let e=Z(`copy`,t.labels.copyDiagram,`mermaid-copy`);e.setAttribute(`data-md-source`,i.ascii||r),s.appendChild(e)}}a.appendChild(o),a.appendChild(s);let c=n.parentElement;c&&c.replaceChild(a,n)}},Rn=(e,t)=>{let n=e.querySelectorAll(`a[href]`);for(let e of Array.from(n)){if(e.getAttribute(`data-md-link-decorated`)===`true`||e.getAttribute(`data-openchamber-file-link`)===`true`)continue;let n=e.getAttribute(`href`)??``;if(!k(n))continue;e.setAttribute(`data-md-link-decorated`,`true`);let r=O(n);if(r){let t=document.createElement(`span`);t.className=`mr-1 inline-flex size-[18px] items-center justify-center rounded border border-[var(--border)] bg-[var(--interactive-hover)] align-middle`;let n=document.createElement(`img`);n.setAttribute(`data-md-link-favicon`,`true`),n.src=r,n.alt=``,n.setAttribute(`aria-hidden`,`true`),n.loading=`lazy`,n.decoding=`async`,n.className=`size-3.5 rounded-sm`,n.addEventListener(`error`,()=>t.remove(),{once:!0}),t.appendChild(n),e.parentNode?.insertBefore(t,e)}if(t.onPreviewLoopback&&D(n)){let r=document.createElement(`button`);r.type=`button`,r.className=`ml-1 align-middle ${bn}`,r.setAttribute(`data-md-action`,`preview-loopback`),r.setAttribute(`data-md-url`,n),r.setAttribute(`title`,t.labels.previewTitle),r.setAttribute(`aria-label`,t.labels.previewLabel),xn(r,yn.download),e.parentNode?.insertBefore(r,e.nextSibling)}}},zn=`img:not([data-md-link-favicon="true"])`,Bn=`[data-md-image-presentation="true"]`,Vn=`data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="576" height="324" viewBox="0 0 576 324"%3E%3C/svg%3E`,Hn=[`block`,`max-w-full`,`rounded-xl`,`border`,`border-border/80`,`bg-[var(--surface-muted)]`,`transition-colors`,`focus-visible:outline`,`focus-visible:outline-2`,`focus-visible:outline-offset-2`,`focus-visible:outline-[var(--interactive-focus-ring)]`],Un=[`cursor-pointer`,`hover:bg-interactive-hover/60`],Wn=[`aspect-video`,`h-auto`,`w-full`,`max-w-xl`,`object-contain`],Gn=e=>{let t=e.parentElement;if(t?.matches(Bn))return t;let n=document.createElement(`span`);n.setAttribute(`data-md-image-presentation`,`true`),n.className=`relative my-4 block w-fit max-w-full`;let r=document.createElement(`span`);r.setAttribute(`data-md-image-placeholder-visual`,`true`),r.setAttribute(`aria-hidden`,`true`),r.className=`pointer-events-none absolute inset-0 flex items-center justify-center text-muted-foreground`;let i=document.createElement(`span`);i.className=`relative flex size-14 items-center justify-center rounded-2xl border border-border/80 bg-[var(--surface-elevated)] shadow-sm`,xn(i,yn.image);let a=document.createElement(`span`);a.setAttribute(`data-md-image-download-badge`,`true`),a.className=`absolute -right-1.5 -bottom-1.5 flex size-6 items-center justify-center rounded-full border border-border bg-[var(--surface-elevated)] text-foreground shadow-sm`,xn(a,yn.imageDownload);let o=document.createElement(`span`);return o.setAttribute(`data-md-image-loading-badge`,`true`),o.className=`absolute -right-1.5 -bottom-1.5 hidden size-6 items-center justify-center rounded-full border border-border bg-[var(--surface-elevated)] text-foreground shadow-sm`,xn(o,yn.imageLoading),i.appendChild(a),i.appendChild(o),r.appendChild(i),t?.replaceChild(n,e),n.appendChild(e),n.appendChild(r),n},Kn=e=>{e.src=Vn,e.setAttribute(`data-md-placeholder-source`,Vn),e.setAttribute(`data-md-image-state`,`placeholder`),e.classList.add(...Wn)},qn=e=>{e.removeAttribute(`data-md-image-state`),e.removeAttribute(`data-md-placeholder-source`),e.removeAttribute(`aria-busy`),e.classList.remove(...Wn)},Jn=(e,t)=>{if(!t.imagePreviewEnabled)return;let n=e.querySelectorAll(zn);for(let e of Array.from(n)){let n=e.getAttribute(`data-md-image-source`)??e.getAttribute(`src`)??``,r=_(n,t.imageEffectiveDirectory);x(r)&&(e.classList.add(...Hn,...Un),e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-md-image-source`,n),Gn(e),Kn(e))}},Yn=(e,t)=>{Pn(e),Ln(e,t),Fn(e,t),In(e),Rn(e,t),Jn(e,t),W(e)},Xn=(e,t,n)=>{let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},Zn=(e,t)=>{let n=e=>{let n=e.target;if(!(n instanceof Element))return;let r=n.closest(`[data-md-action]`);if(!r)return;let i=r.getAttribute(`data-md-action`)??``;if(i===`copy-code`){let e=r.closest(`[data-component="markdown-code"]`)?.querySelector(`code`)?.textContent??``;e&&p(e).then(()=>Nn(r,t.labels.copied,`copy`,t.labels.copy));return}if(i===`toggle-code-wrap`){e.preventDefault(),t.onToggleCodeBlockLineWrap?.();return}if(i===`mermaid-copy`){let e=r.getAttribute(`data-md-source`)??``;e&&p(e).then(()=>Nn(r,t.labels.copied,`copy`,t.labels.copyDiagram));return}if(i===`mermaid-zoom-in`||i===`mermaid-zoom-out`||i===`mermaid-fit`){e.preventDefault();let t=un(r.closest(`[data-markdown="mermaid-block"]`));i===`mermaid-zoom-in`?t?.zoomIn():i===`mermaid-zoom-out`?t?.zoomOut():t?.fit();return}if(i===`mermaid-download`){let e=r.closest(`[data-markdown="mermaid-block"]`)?.querySelector(`[data-markdown="mermaid"]`),t=e?.getAttribute(`data-md-original-svg`)??e?.innerHTML??``;t&&Xn(`diagram.svg`,t,`image/svg+xml;charset=utf-8`);return}if(i===`preview-loopback`){e.preventDefault();let n=r.getAttribute(`data-md-url`)??``;n&&t.onPreviewLoopback?.(n);return}};return e.addEventListener(`click`,n),()=>e.removeEventListener(`click`,n)},Q=i(),Qn=()=>{let e=(0,_e.c)(4),t=g(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=y(!1),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=y(!0),e[1]=i):i=e[1];let a=i,o;return e[2]===t?.currentTheme?o=e[3]:(o=t?.currentTheme??(typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?a:r),e[2]=t?.currentTheme,e[3]=o),o},$n=e=>{let t=(0,_e.c)(2),{containerRef:n,enabled:r}=e,i;t[0]===r?i=t[1]:(i=e=>{if(r===!1||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;let t=e.target;if(!(t instanceof Element)||t.closest($))return;let n=t.closest(`a[href]`);if(!(n instanceof HTMLAnchorElement)||n.getAttribute(`data-openchamber-file-link`)===`true`)return;let i=n.getAttribute(`href`)??``;k(i)&&(e.preventDefault(),e.stopPropagation(),E(i))},t[0]=r,t[1]=i);let a=l(i);u(`click`,a,n)},$=`img:not([data-md-link-favicon="true"])`,er=e=>e.getAttribute(`data-md-image-source`)??e.getAttribute(`src`)??``,tr=({containerRef:e,effectiveDirectory:n,onShowPopup:r})=>{let i=G.useRef(null);i.current??=t();let a=i.current,o=!!r,s=l(e=>r?.(e)),c=G.useRef(()=>{}),u=G.useRef(new Map),d=G.useRef(null),f=G.useMemo(()=>e=>c.current(e),[]);return G.useLayoutEffect(()=>{let t=u.current;if(d.current!==null&&(clearTimeout(d.current),d.current=null),c.current=()=>{},!o){for(let[e,n]of t)n.controller?.abort(),n.objectUrl&&C(n.objectUrl),t.delete(e);return}let r=e.current;if(!r)return;let i=e=>{let t=Array.from(r.querySelectorAll($));if(t.indexOf(e)<0)return;let n=t.map(e=>({url:er(e),filename:e.alt||er(e)||void 0})).filter(e=>e.url),i=er(e),a=n.findIndex(e=>e.url===i),o=e.alt||i;s({open:!0,title:o,content:``,metadata:{tool:`image-preview`,filename:o},image:{url:i,filename:o,gallery:n,index:Math.max(0,a)}})},l=e=>{let n=t.get(e);n&&(n.controller?.abort(),n.objectUrl&&C(n.objectUrl),t.delete(e))},f=e=>{let t=er(e),r=_(t,n);if(x(r))return`${a}\n${n}\n${t}`},p=e=>{let n=f(e);if(!n){l(e);return}let r=t.get(e);if(r?.key===n)return r;l(e);let i={key:n};return t.set(e,i),i},m=(e,i)=>{if(i.controller||i.objectUrl||!r.contains(e))return;let a=er(e),o=_(a,n);if(!x(o)){l(e);return}let s=new AbortController;i.controller=s,e.setAttribute(`data-md-image-state`,`loading`),e.setAttribute(`aria-busy`,`true`),S(o.path,s.signal).then(n=>{let r=t.get(e);if(!r||r!==i||r.controller!==s||s.signal.aborted){C(n);return}r.controller=void 0,r.objectUrl=n,qn(e),e.setAttribute(`data-md-image-state`,`loaded`),e.src=n}).catch(()=>{let n=t.get(e);n===i&&(n.controller=void 0,e.removeAttribute(`aria-busy`),e.setAttribute(`data-md-image-state`,`placeholder`))})};c.current=e=>{for(let[n,r]of t)(!e.contains(n)||f(n)!==r.key)&&l(n);for(let t of Array.from(e.querySelectorAll($))){let e=p(t);e&&!e.objectUrl&&m(t,e)}},c.current(r);let h=e=>{let t=p(e);if(t&&!t.objectUrl){m(e,t);return}i(e)},g=e=>{let t=er(e);t&&v({sourceUrl:t,displayUrl:e.currentSrc||e.src||void 0,filename:e.alt||t,effectiveDirectory:n})},y=F(),b=e=>er(e)||e.src||`markdown-image`,w=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest($);if(n){if(y.consumeClick(b(n))){e.preventDefault(),e.stopPropagation();return}e.preventDefault(),e.stopPropagation(),h(n)}},T=e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target;!(t instanceof HTMLImageElement)||!t.matches($)||(e.preventDefault(),e.stopPropagation(),h(t))},E=e=>{if(e.pointerType===`mouse`&&e.button!==0)return;let t=e.target;if(!(t instanceof Element))return;let n=t.closest($);n&&y.start({pointerId:e.pointerId,key:b(n),clientX:e.clientX,clientY:e.clientY,onTrigger:()=>g(n)})},D=e=>{y.move(e.pointerId,e.clientX,e.clientY)},O=e=>{y.end(e.pointerId)},k=e=>{y.cancel(e.pointerId)},A=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest($);n&&(e.preventDefault(),e.stopPropagation(),y.openFromContextMenu(b(n),()=>g(n)))};return r.addEventListener(`click`,w),r.addEventListener(`keydown`,T),r.addEventListener(`pointerdown`,E),r.addEventListener(`pointermove`,D),r.addEventListener(`pointerup`,O),r.addEventListener(`pointercancel`,k),r.addEventListener(`contextmenu`,A),()=>{c.current=()=>{},y.reset(),r.removeEventListener(`click`,w),r.removeEventListener(`keydown`,T),r.removeEventListener(`pointerdown`,E),r.removeEventListener(`pointermove`,D),r.removeEventListener(`pointerup`,O),r.removeEventListener(`pointercancel`,k),r.removeEventListener(`contextmenu`,A),d.current=setTimeout(()=>{d.current=null;for(let e of Array.from(t.keys()))r.contains(e)&&Kn(e),l(e)},0)}},[e,n,o,a]),{reconcileMarkdownImageResources:f,transportIdentity:a}},nr={download:!0,copy:!0,showPanZoomControls:!0},rr=!0,ir=e=>{let t=e.match(/^(?:\uFEFF)?(---|\+\+\+)[^\S\r\n]*\r?\n[\s\S]*?\r?\n\1[^\S\r\n]*(?:\r?\n|$)/);return t?e.slice(t[0].length):e},ar=160,or=e=>{let t=(0,_e.c)(8),{containerRef:n,effectiveDirectory:r,editor:i,preferRuntimeEditor:a,onShowPopup:o,enabled:s}=e,c=G.useRef(null),l,u;t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==s||t[4]!==o||t[5]!==a?(l=()=>{let e=n.current;if(!e)return;let t=!1,l=m(),u=me(),d=s,f=Er,p=()=>{let t=e.querySelectorAll(U);for(let e of Array.from(t))f(e)};if(!d){p();return}let h=e=>{let n=e===void 0?0:e;if(c.current!==null&&typeof window<`u`&&window.clearTimeout(c.current),typeof window>`u`){g();return}c.current=window.setTimeout(()=>{c.current=null,window.requestAnimationFrame(()=>{t||g()})},n)},g=()=>{let n=e.querySelectorAll(`[data-markdown="inline-code"], a, ${fe}`),i=0;for(let a of Array.from(n)){let n=pe(a),o=de(n,r);if(!o){f(a);continue}if(i>=u){f(a);continue}i+=1,(a.getAttribute(`data-openchamber-file-link`)!==`true`||a.getAttribute(`data-openchamber-file-path`)!==o.resolvedPath)&&he(o.resolvedPath,r).then(n=>{if(t||!e.contains(a))return;let i=pe(a),s=de(i,r);if(!(!s||s.resolvedPath!==o.resolvedPath)){if(!le(s.resolvedPath,n,l)){f(a);return}a.setAttribute(`data-openchamber-file-link`,`true`),a.setAttribute(`data-openchamber-file-ref`,i),a.setAttribute(`data-openchamber-file-path`,s.resolvedPath),a.setAttribute(`data-openchamber-file-binary`,String(n.isBinary)),a.setAttribute(`title`,ge),a.tagName.toLowerCase()!==`a`&&(a.setAttribute(`role`,`button`),a.setAttribute(`tabindex`,`0`))}})}},_=e=>ce(e,{effectiveDirectory:r,editor:i,preferRuntimeEditor:a,onShowPopup:o}),v=e=>{let t=e.target;if(!(t instanceof Element)||t.closest($))return;let n=t.closest(U);n instanceof HTMLElement&&(e.preventDefault(),e.stopPropagation(),_(n))},y=e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target;!(t instanceof HTMLElement)||t.getAttribute(`data-openchamber-file-link`)!==`true`||(e.preventDefault(),e.stopPropagation(),_(t))};h(ar);let b=new MutationObserver(()=>{h(ar)});return b.observe(e,{childList:!0,subtree:!0}),e.addEventListener(`click`,v),e.addEventListener(`keydown`,y),()=>{t=!0,c.current!==null&&typeof window<`u`&&window.clearTimeout(c.current),c.current=null,b.disconnect(),e.removeEventListener(`click`,v),e.removeEventListener(`keydown`,y)}},u=[n,i,r,o,a,s],t[0]=n,t[1]=i,t[2]=r,t[3]=s,t[4]=o,t[5]=a,t[6]=l,t[7]=u):(l=t[6],u=t[7]),G.useEffect(l,u)},sr=({containerRef:e,onShowPopup:t,enableFullscreen:n,enablePanZoom:r,allowMermaidWheelEvents:i})=>{let a=l(e=>t?.(e)),o=!!t,s=l(t=>{if(!n||!o)return;let r=e.current;if(!r)return;let i=t.target;if(!(i instanceof Element)||i.closest(`button, a, [role="button"]`))return;let s=i.closest(Yt);if(!s)return;if(s instanceof HTMLElement&&s.hasAttribute(`data-mermaid-suppress-click`)){s.removeAttribute(`data-mermaid-suppress-click`);return}let c=Array.from(r.querySelectorAll(Yt)).indexOf(s);if(c<0)return;let l=s instanceof HTMLElement?s.getAttribute(`data-md-source`):null;if(!l||l.trim().length===0)return;let u=`Diagram ${c+1}`;a({open:!0,title:u,content:``,metadata:{tool:`mermaid-preview`,filename:u},mermaid:{url:`data:text/plain;charset=utf-8,${encodeURIComponent(l)}`,source:l,filename:u}})}),c=l(e=>{if(i||r)return;let t=e.target;t instanceof Element&&t.closest(`[data-markdown="mermaid-block"]`)&&e.stopPropagation()});u(`click`,s,e),G.useEffect(()=>{let t=e.current;if(t)return t.addEventListener(`wheel`,c,{capture:!0,passive:!0}),()=>{t.removeEventListener(`wheel`,c,!0)}},[e])},cr=24,lr=1,ur=12,dr=/[\s.,!?;:)\]]/,fr=(e,t)=>{let n=e<=12?2:e<=48?4:e<=96?8:Math.min(24,Math.ceil(e/8));return Math.max(1,Math.round(t/cr*n))},pr=(e,t)=>fr(e,t)*(1e3/t),mr=(e,t,n)=>{let r=Math.min(e.length,t+n);for(let t=r;t<Math.min(e.length,r+8);t+=1)if(dr.test(e[t]??``))return t+1;return r},hr=(e,t,n)=>{let[r,i]=G.useState(()=>t?0:e.length),a=G.useRef(r),o=G.useRef(0),s=G.useRef(null);return a.current=r,G.useEffect(()=>{if(!t||typeof window>`u`){o.current=0,s.current=null,i(e.length);return}a.current>e.length&&(a.current=e.length,o.current=0,i(e.length));let r=null,c=t=>{let l=Math.min(a.current,e.length);if(l>=e.length){r=null,s.current=null;return}let u=s.current;if(u===null){s.current=t,r=window.requestAnimationFrame(c);return}let d=Math.min(t-u,100);s.current=t,o.current+=pr(e.length-l,n)*(d/1e3);let f=Math.min(ur,Math.floor(o.current));if(f>=lr){o.current-=f;let t=mr(e,l,f);a.current=t,i(t)}r=window.requestAnimationFrame(c)};return a.current<e.length&&(r=window.requestAnimationFrame(c)),()=>{r!==null&&window.cancelAnimationFrame(r)}},[e,t,n]),t?e.slice(0,Math.min(r,e.length)):e},gr=new A({maxEntries:100,maxBytes:8388608}),_r=(e,t)=>{let n=gr.get(e);if(n)return n;let r=t(),i=((r.svg?.length??0)+(r.ascii?.length??0))*2;return gr.set(e,r,e.length*2+i),r},vr=e=>({bg:e.colors.surface.elevated,fg:e.colors.surface.foreground,line:e.colors.interactive.border,accent:e.colors.primary.base,muted:e.colors.surface.mutedForeground,surface:e.colors.surface.muted,border:e.colors.interactive.border,transparent:!0,font:`system-ui, sans-serif`}),yr=(e,r,i,a=nr,o=t(),s=``,c=!1)=>{let{t:u}=f(),d=G.useMemo(()=>({copy:u(`markdownRenderer.code.actions.copyTitle`),copied:u(`markdownRenderer.code.actions.copiedTitle`),enableCodeWrap:u(`markdownRenderer.code.actions.enableWrapTitle`),disableCodeWrap:u(`markdownRenderer.code.actions.disableWrapTitle`),copyDiagram:u(`markdownRenderer.mermaid.actions.copySourceTitle`),downloadDiagram:u(`markdownRenderer.mermaid.actions.downloadSvgTitle`),zoomInDiagram:u(`markdownRenderer.mermaid.actions.zoomInTitle`),zoomOutDiagram:u(`markdownRenderer.mermaid.actions.zoomOutTitle`),resetDiagramView:u(`markdownRenderer.mermaid.actions.resetViewTitle`),previewLabel:u(`terminalView.preview.open`),previewTitle:u(`terminalView.preview.openTitle`)}),[u]),p=n(e=>e.codeBlockLineWrap),m=n(e=>e.setCodeBlockLineWrap),h=l(()=>{m(!n.getState().codeBlockLineWrap)});return G.useMemo(()=>{let t=vr(e),l=n.getState().mermaidRenderingMode,u=e.metadata?.id??`theme`;return{labels:d,mermaidControls:a,codeBlockLineWrap:p,deferCodeLineNumberSync:r,onToggleCodeBlockLineWrap:h,renderMermaid:e=>_r(`${u}:${l}:${e}`,()=>{try{return l===`ascii`?{ascii:z(e)}:{svg:R(e,t)}}catch{return{}}}),onPreviewLoopback:i,imageTransportIdentity:o,imageEffectiveDirectory:s,imagePreviewEnabled:c}},[e,d,a,p,r,i,o,s,c])},br=({containerRef:e,text:t,streaming:n,cacheKey:r,syntaxVars:i,ctx:a,reconcileMarkdownImageResources:o,onRichContentReady:s})=>{G.useEffect(()=>{w()},[]);let c=G.useRef(null),u=l(()=>{s?.()}),f=l(()=>{let t=e.current;if(t){if(!c.current){if(!Xt(t))return;c.current=vn(t);return}c.current.refresh()}});G.useLayoutEffect(()=>{let r=e.current,i=r?.querySelector(`[data-markdown-content]`)??r;if(i&&t&&i.childNodes.length===0){for(let e of jt(t)){let t=document.createElement(`div`);t.setAttribute(`data-md-block`,``),t.style.display=`contents`,t.innerHTML=e,Yn(t,a),i.appendChild(t)}o(i),n||u()}},[e,a,o,n,t]),G.useEffect(()=>()=>{c.current?.cleanup(),c.current=null},[]),G.useEffect(()=>{let i=e.current;if(!i)return;let s=i.querySelector(`[data-markdown-content]`)??i,c=!0,l=new AbortController,d=()=>{},p=()=>{},m=()=>{if(!c||n||l.signal.aborted)return;s.replaceChildren();let e=document.createElement(`div`);e.setAttribute(`data-md-block`,``),e.setAttribute(`data-md-render-fallback`,`text`),e.style.display=`contents`;let r=document.createElement(`span`);r.style.whiteSpace=`pre-wrap`,r.textContent=t,e.appendChild(r),s.appendChild(e),o(s),u()},h=e=>{if(!c)return;let t=Array.from(s.children);e.forEach((e,n)=>{let r=t[n];if(r||(r=document.createElement(`div`),r.setAttribute(`data-md-block`,``),r.style.display=`contents`,s.appendChild(r)),r.getAttribute(`data-md-id`)===e.id)return;let i=document.createElement(`div`);i.innerHTML=e.html,Yn(i,a);let o=Xt(r),c=Xt(i);L(r,i,{childrenOnly:!0,onBeforeElUpdated:(e,t)=>{if(Te(e,t))return!1;if(ue(e,t),e instanceof HTMLImageElement&&t instanceof HTMLImageElement){let n=e.getAttribute(`data-md-image-source`);if(n&&n===t.getAttribute(`data-md-image-source`)){let n=e.getAttribute(`src`);n===null?t.removeAttribute(`src`):t.setAttribute(`src`,n),t.className=e.className;for(let n of[`data-md-image-state`,`data-md-placeholder-source`,`aria-busy`]){let r=e.getAttribute(n);r===null?t.removeAttribute(n):t.setAttribute(n,r)}}}return!e.isEqualNode(t)}}),r.setAttribute(`data-md-id`,e.id),(o||c||Xt(r))&&f()});let n=Xt(s),r=!1;for(let n=t.length-1;n>=e.length;--n){let e=t[n];e&&Xt(e)&&(r=!0),e?.remove()}(r||t.length>e.length&&n)&&f(),o(s),a.deferCodeLineNumberSync||Mn(s,a.codeBlockLineWrap,a.labels),ke(s,I,{signal:l.signal,priority:`visible`}),u()},g=e=>{try{h(e)}catch{m()}},_=()=>{Rt(t,n,r,l.signal).then(e=>{if(c){if(n){g(e);return}p=M(()=>g(e),{priority:`visible`})}}).catch(m)};return n?_():d=M(_,{priority:`visible`}),()=>{c=!1,l.abort(),d(),p()}},[e,t,n,r,a,o]),G.useEffect(()=>{let t=e.current;if(t)return Zn(t,a)},[e,a]),G.useEffect(()=>{let t=e.current,n=t?.querySelector(`[data-markdown-content]`)??t;if(n)for(let[e,t]of Object.entries(i))n.style.setProperty(e,t)},[e,i]),G.useEffect(()=>{let t=e.current,n=t?.querySelector(`[data-markdown-content]`)??t;n&&(a.deferCodeLineNumberSync||Mn(n,a.codeBlockLineWrap,a.labels))},[e,a.codeBlockLineWrap,a.deferCodeLineNumberSync,a.labels]);let p=G.useRef(null),m=l(()=>{let t=e.current,n=t?.querySelector(`[data-markdown-content]`)??t;n&&(p.current!==null&&window.cancelAnimationFrame(p.current),p.current=window.requestAnimationFrame(()=>{p.current=null,An(n)}))});d(e,m),G.useEffect(()=>()=>{p.current!==null&&window.cancelAnimationFrame(p.current)},[])},xr=e=>e===`tool`?`markdown-content markdown-tool`:e===`reasoning`?`markdown-content markdown-reasoning`:`markdown-content leading-relaxed`,Sr=e=>{let t=(0,_e.c)(4),[n,r]=G.useState(e),i=G.useRef(e),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{i.current||(i.current=!0,r(!0))},t[0]=a):a=t[0];let o=l(a),s;return t[1]!==o||t[2]!==n?(s=[n,o],t[1]=o,t[2]=n,t[3]=s):s=t[3],s},Cr=(e,t,n)=>{let r=G.useRef(n);r.current=n;let i=G.useRef(t);i.current=t;let a=l(e=>{if(!r.current)return;let t=e[0];if(!t)return;let n=t.borderBoxSize?.[0],a=n?n.blockSize:t.contentRect.height,o=n?n.inlineSize:t.contentRect.width;j(i.current,a,o)});d(e,a)},wr=G.memo(e=>{let t=(0,_e.c)(52),{content:r,part:i,messageId:a,isAnimated:s,skipFadeIn:c,className:u,isStreaming:d,disableStreamAnimation:f,variant:p,onShowPopup:m,enableFileReferences:g}=e,_=s===void 0||s,v=c!==void 0&&c,y=d!==void 0&&d,x=f!==void 0&&f,S=p===void 0?`assistant`:p,C=g===void 0||g,w=Qn(),{editor:E,runtime:D}=T(),O=G.useRef(null),k=te()??``,A=n(Dr),j;t[0]!==k||t[1]!==A?(j=e=>{k&&A(k,e)},t[0]=k,t[1]=A,t[2]=j):j=t[2];let ne=l(j),M=y&&!x,N;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(N=ie(o()),t[3]=N):N=t[3];let P=hr(r,M,N.markdownPaceMs),[F,oe]=Sr(M),I;t[4]===m?I=t[5]:(I={containerRef:O,onShowPopup:m,enableFullscreen:rr,enablePanZoom:nr.showPanZoomControls},t[4]=m,t[5]=I),sr(I);let se=C&&!y,L;t[6]!==E||t[7]!==k||t[8]!==m||t[9]!==D.isVSCode||t[10]!==se?(L={containerRef:O,effectiveDirectory:k,editor:E,preferRuntimeEditor:D.isVSCode,onShowPopup:m,enabled:se},t[6]=E,t[7]=k,t[8]=m,t[9]=D.isVSCode,t[10]=se,t[11]=L):L=t[11],or(L);let R;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(R={containerRef:O},t[12]=R):R=t[12],$n(R);let z;t[13]!==k||t[14]!==m?(z={containerRef:O,effectiveDirectory:k,onShowPopup:m},t[13]=k,t[14]=m,t[15]=z):z=t[15];let{reconcileMarkdownImageResources:B,transportIdentity:V}=tr(z),H;t[16]===w?H=t[17]:(H=b(w),t[16]=w,t[17]=H);let ce=H,le=yr(w,M,k?ne:void 0,nr,V,k,!!m),U=`markdown-${i?.id?`part-${i.id}`:`message-${a}`}`,ue;t[18]!==U||t[19]!==le||t[20]!==M||t[21]!==P||t[22]!==B||t[23]!==oe||t[24]!==ce?(ue={containerRef:O,text:P,streaming:M,cacheKey:U,syntaxVars:ce,ctx:le,reconcileMarkdownImageResources:B,onRichContentReady:oe},t[18]=U,t[19]=le,t[20]=M,t[21]=P,t[22]=B,t[23]=oe,t[24]=ce,t[25]=ue):ue=t[25],br(ue);let de;t[26]!==r||t[27]!==S?(de=ee(r,S),t[26]=r,t[27]=S,t[28]=de):de=t[28],Cr(O,de,F&&!M);let fe=!F||void 0,W;t[29]===u?W=t[30]:(W=h(`relative break-words w-full min-w-0`,u),t[29]=u,t[30]=W);let pe=F?`true`:`false`,me=F?`ready`:`pending`,he;t[31]!==P||t[32]!==F||t[33]!==S?(he=!F&&(0,Q.jsx)(`div`,{className:h(xr(S),`pointer-events-none absolute inset-0 overflow-hidden`),children:(0,Q.jsx)(ae,{content:P})}),t[31]=P,t[32]=F,t[33]=S,t[34]=he):he=t[34];let ge=!F||void 0,K;t[35]!==F||t[36]!==S?(K=h(xr(S),!F&&`invisible`),t[35]=F,t[36]=S,t[37]=K):K=t[37];let q;t[38]!==ge||t[39]!==K?(q=(0,Q.jsx)(`div`,{"aria-hidden":ge,className:K,"data-markdown-content":!0}),t[38]=ge,t[39]=K,t[40]=q):q=t[40];let ve;t[41]!==fe||t[42]!==W||t[43]!==pe||t[44]!==me||t[45]!==he||t[46]!==q?(ve=(0,Q.jsxs)(`div`,{"aria-busy":fe,className:W,"data-markdown-ready":pe,"data-markdown-hydration":me,ref:O,children:[he,q]}),t[41]=fe,t[42]=W,t[43]=pe,t[44]=me,t[45]=he,t[46]=q,t[47]=ve):ve=t[47];let ye=ve;if(_){let e;return t[48]!==U||t[49]!==ye||t[50]!==v?(e=(0,Q.jsx)(re,{skipAnimation:v,children:ye},U),t[48]=U,t[49]=ye,t[50]=v,t[51]=e):e=t[51],e}return ye},(e,t)=>e.content===t.content&&e.isStreaming===t.isStreaming&&e.disableStreamAnimation===t.disableStreamAnimation&&e.variant===t.variant&&e.isAnimated===t.isAnimated&&e.skipFadeIn===t.skipFadeIn&&e.className===t.className&&e.messageId===t.messageId&&e.onShowPopup===t.onShowPopup&&e.enableFileReferences===t.enableFileReferences&&e.part?.id===t.part?.id),Tr=G.memo(e=>{let t=(0,_e.c)(46),{content:n,className:r,variant:i,disableLinkSafety:a,stripFrontmatter:o,onShowPopup:s,mermaidControls:c,allowMermaidWheelEvents:l,enableFileReferences:u}=e,d=i===void 0?`assistant`:i,f=o!==void 0&&o,p=c===void 0?nr:c,m=l!==void 0&&l,g=u===void 0||u,{editor:_,runtime:v}=T(),y=Qn(),x=G.useRef(null),[S,C]=Sr(!1),w=te()??``,E;t[0]!==n||t[1]!==f?(E=f?ir(n):n,t[0]=n,t[1]=f,t[2]=E):E=t[2];let D=E,O;t[3]!==m||t[4]!==p.showPanZoomControls||t[5]!==s?(O={containerRef:x,onShowPopup:s,enableFullscreen:rr,enablePanZoom:p.showPanZoomControls,allowMermaidWheelEvents:m},t[3]=m,t[4]=p.showPanZoomControls,t[5]=s,t[6]=O):O=t[6],sr(O);let k;t[7]!==_||t[8]!==w||t[9]!==g||t[10]!==s||t[11]!==v.isVSCode?(k={containerRef:x,effectiveDirectory:w,editor:_,preferRuntimeEditor:v.isVSCode,onShowPopup:s,enabled:g},t[7]=_,t[8]=w,t[9]=g,t[10]=s,t[11]=v.isVSCode,t[12]=k):k=t[12],or(k);let A=!a,j;t[13]===A?j=t[14]:(j={containerRef:x,enabled:A},t[13]=A,t[14]=j),$n(j);let ee;t[15]!==w||t[16]!==s?(ee={containerRef:x,effectiveDirectory:w,onShowPopup:s},t[15]=w,t[16]=s,t[17]=ee):ee=t[17];let{reconcileMarkdownImageResources:ne,transportIdentity:M}=tr(ee),N;t[18]===y?N=t[19]:(N=b(y),t[18]=y,t[19]=N);let re=N,P=yr(y,!1,void 0,p,M,w,!!s),ie=`simple:${d}`,F;t[20]!==P||t[21]!==ne||t[22]!==D||t[23]!==C||t[24]!==re||t[25]!==ie?(F={containerRef:x,text:D,streaming:!1,cacheKey:ie,syntaxVars:re,ctx:P,reconcileMarkdownImageResources:ne,onRichContentReady:C},t[20]=P,t[21]=ne,t[22]=D,t[23]=C,t[24]=re,t[25]=ie,t[26]=F):F=t[26],br(F);let oe=!S||void 0,I;t[27]===r?I=t[28]:(I=h(`relative break-words w-full min-w-0`,r),t[27]=r,t[28]=I);let se=S?`true`:`false`,L=S?`ready`:`pending`,R;t[29]!==D||t[30]!==S||t[31]!==d?(R=!S&&(0,Q.jsx)(`div`,{className:h(xr(d),`pointer-events-none absolute inset-0 overflow-hidden`),children:(0,Q.jsx)(ae,{content:D})}),t[29]=D,t[30]=S,t[31]=d,t[32]=R):R=t[32];let z=!S||void 0,B;t[33]!==S||t[34]!==d?(B=h(xr(d),!S&&`invisible`),t[33]=S,t[34]=d,t[35]=B):B=t[35];let V;t[36]!==z||t[37]!==B?(V=(0,Q.jsx)(`div`,{"aria-hidden":z,className:B,"data-markdown-content":!0}),t[36]=z,t[37]=B,t[38]=V):V=t[38];let H;return t[39]!==oe||t[40]!==I||t[41]!==se||t[42]!==L||t[43]!==R||t[44]!==V?(H=(0,Q.jsxs)(`div`,{"aria-busy":oe,className:I,"data-markdown-ready":se,"data-markdown-hydration":L,ref:x,children:[R,V]}),t[39]=oe,t[40]=I,t[41]=se,t[42]=L,t[43]=R,t[44]=V,t[45]=H):H=t[45],H},(e,t)=>{let n=e.mermaidControls??nr,r=t.mermaidControls??nr;return e.content===t.content&&e.variant===t.variant&&e.className===t.className&&e.disableLinkSafety===t.disableLinkSafety&&e.stripFrontmatter===t.stripFrontmatter&&e.onShowPopup===t.onShowPopup&&n.download===r.download&&n.copy===r.copy&&n.showPanZoomControls===r.showPanZoomControls&&e.allowMermaidWheelEvents===t.allowMermaidWheelEvents&&e.enableFileReferences===t.enableFileReferences});function Er(e){e.removeAttribute(`data-openchamber-file-link`),e.removeAttribute(`data-openchamber-file-ref`),e.removeAttribute(`data-openchamber-file-path`),e.removeAttribute(`data-openchamber-file-binary`),e.getAttribute(`title`)===`Open file`&&e.removeAttribute(`title`),e.tagName.toLowerCase()!==`a`&&(e.removeAttribute(`role`),e.removeAttribute(`tabindex`))}function Dr(e){return e.openContextPreview}export{wr as MarkdownRenderer,Tr as SimpleMarkdownRenderer};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{n as r}from"./vendor-react-DLPElpoQ.js";import{a as i,i as a,n as o,r as s,t as c}from"./vendor-markstream-react-C3K8YH0d.js";import{n as l,r as u,u as d}from"./vendor-reactuses-core-DDoDDyM9.js";import{Mi as f}from"./useMobileNavigationStore-DxH1DjU-.js";import{t as p}from"./utils-B0mQXN9L.js";import{t as m}from"./useThemeSystem-DMzWVJaW.js";import{n as h}from"./useRuntimeAPIs-DSLXJybW.js";import{a as g,r as _}from"./url-CE_gAfNa.js";import{r as v,t as y}from"./markdownHeightCache-Bj707yG-.js";import{n as b}from"./useEffectiveDirectory-DqOLKISv.js";import{a as x,c as S,d as C,h as w,i as T,o as E,p as D,r as O,s as k,t as A}from"./fileReferenceActions-3pPDAJSl.js";var j=e(n(),1),M=`img:not([data-md-link-favicon="true"])`,N=e=>e.getAttribute(`data-md-image-source`)??e.getAttribute(`src`)??``,P=(e,t)=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;let n=e.target;if(!(n instanceof Element))return;let r=n.closest(M);if(r instanceof HTMLImageElement&&t.onShowPopup){let n=e.currentTarget;if(!(n instanceof HTMLElement))return;let i=Array.from(n.querySelectorAll(M)).map(e=>({url:N(e),filename:e.alt||N(e)||void 0})).filter(e=>e.url),a=N(r),o=i.findIndex(e=>e.url===a);if(!a)return;e.preventDefault(),e.stopPropagation(),t.onShowPopup({open:!0,title:r.alt||a,content:``,image:{url:a,filename:r.alt||a,gallery:i,index:o>=0?o:0}});return}if(t.fileReference){let r=n.closest(C);if(r instanceof HTMLElement){e.preventDefault(),e.stopPropagation(),x(r,t.fileReference);return}}let i=n.closest(`a[href]`);if(!(i instanceof HTMLAnchorElement))return;let a=i.getAttribute(`href`)??``;_(a)&&(e.preventDefault(),e.stopPropagation(),g(a))},F=(e,t)=>{if(e.key!==`Enter`&&e.key!==` `||!t.fileReference)return;let n=e.target;if(!(n instanceof Element))return;let r=n.closest(C);!(r instanceof HTMLElement)||r.getAttribute(`data-openchamber-file-link`)!==`true`||(e.preventDefault(),e.stopPropagation(),x(r,t.fileReference))},I=r(),L=(e,t)=>{let n=t>=2?e.slice(t-2,t):``;return(t>=1?e.charAt(t-1):``)===`:`||n===`:/`},R=e=>{if(!e.includes(`/`)||!e.includes(`.`))return[{kind:`text`,value:e}];w.lastIndex=0;let t=[],n=0,r=w.exec(e);for(;r;){let i=r[0];if(!i||L(e,r.index)||!D(i)){r=w.exec(e);continue}r.index>n&&t.push({kind:`text`,value:e.slice(n,r.index)}),t.push({kind:`path`,value:i}),n=r.index+i.length,r=w.exec(e)}return n===0?[{kind:`text`,value:e}]:(n<e.length&&t.push({kind:`text`,value:e.slice(n)}),t)},z=t(),B=j.createContext({enabled:!1,insideLink:!1,isMobileSurface:!1,effectiveDirectory:``,preferRuntimeEditor:!1,slots:{used:0,limit:0}}),V=!1,H=()=>{V||(V=!0,i({text:G,inline_code:K,link:q}))},U=e=>{let t=(0,I.c)(11),{enabled:n,effectiveDirectory:r,editor:i,preferRuntimeEditor:a,onShowPopup:o,content:s,children:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=f(),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={used:0,limit:O()},t[1]=u):u=t[1];let d;t[2]!==i||t[3]!==r||t[4]!==n||t[5]!==o||t[6]!==a?(d={enabled:n,insideLink:!1,isMobileSurface:l,effectiveDirectory:r,editor:i,preferRuntimeEditor:a,onShowPopup:o,slots:u},t[2]=i,t[3]=r,t[4]=n,t[5]=o,t[6]=a,t[7]=d):d=t[7];let p=d,m;return t[8]!==c||t[9]!==p?(m=(0,z.jsx)(B.Provider,{value:p,children:c}),t[8]=c,t[9]=p,t[10]=m):m=t[10],m},W=({raw:e,children:t})=>{let n=j.useContext(B),r=T(e,n.effectiveDirectory),i=j.useRef(!1);n.enabled&&r&&!i.current&&n.slots.used<n.slots.limit&&(n.slots.used+=1,i.current=!0);let[a,o]=j.useState(r?E(r.resolvedPath)??null:null),s=r?.resolvedPath;if(j.useEffect(()=>{if(!n.enabled||!s||!i.current)return;let e=!1;return k(s,n.effectiveDirectory).then(t=>{e||o(t)}),()=>{e=!0}},[n.enabled,n.effectiveDirectory,s]),!r)return t??e;let c=!!(i.current&&a&&S(r.resolvedPath,a,n.isMobileSurface));return(0,z.jsx)(`span`,{"data-openchamber-block-path-token":`true`,...c?{"data-openchamber-file-link":`true`,"data-openchamber-file-ref":e,"data-openchamber-file-path":r.resolvedPath,"data-openchamber-file-binary":String(a?.isBinary===!0),title:A,...t?{}:{role:`button`,tabIndex:0}}:{},children:t??e})};function G(e){let t=(0,I.c)(12),n=j.useContext(B),r=e.node.content??``;if(!n.enabled||n.insideLink){let n;return t[0]===e?n=t[1]:(n=(0,z.jsx)(s,{...e}),t[0]=e,t[1]=n),n}let i,a;if(t[2]!==r||t[3]!==e){a=Symbol.for(`react.early_return_sentinel`);bb0:{let n=R(r);if(n.length===1&&n[0]?.kind!==`path`){let n;t[6]===e?n=t[7]:(n=(0,z.jsx)(s,{...e}),t[6]=e,t[7]=n),a=n;break bb0}let o;t[8]===e?o=t[9]:(o=(t,n)=>t.kind===`path`?(0,z.jsx)(W,{raw:t.value},`path-${n}-${t.value}`):(0,z.jsx)(s,{...e,node:{...e.node,content:t.value}},`text-${n}`),t[8]=e,t[9]=o),i=n.map(o)}t[2]=r,t[3]=e,t[4]=i,t[5]=a}else i=t[4],a=t[5];if(a!==Symbol.for(`react.early_return_sentinel`))return a;let o;return t[10]===i?o=t[11]:(o=(0,z.jsx)(z.Fragment,{children:i}),t[10]=i,t[11]=o),o}function K(e){let t=(0,I.c)(7),n=j.useContext(B),r=e.node.code??``;if(!n.enabled||!D(r)){let n;return t[0]===e?n=t[1]:(n=(0,z.jsx)(a,{...e}),t[0]=e,t[1]=n),n}let i;t[2]===r?i=t[3]:(i=(0,z.jsx)(W,{raw:r}),t[2]=r,t[3]=i);let o;return t[4]!==e||t[5]!==i?(o=(0,z.jsx)(a,{...e,children:i}),t[4]=e,t[5]=i,t[6]=o):o=t[6],o}function q(e){let t=(0,I.c)(12),n=j.useContext(B),r=e.node.href??``,i;t[0]!==n.enabled||t[1]!==r?(i=n.enabled&&D(r),t[0]=n.enabled,t[1]=r,t[2]=i):i=t[2];let a=i,s;t[3]===n?s=t[4]:(s={...n,insideLink:!0},t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==r||t[7]!==e?(c=a?(0,z.jsx)(W,{raw:r,children:(0,z.jsx)(o,{...e})}):(0,z.jsx)(o,{...e}),t[5]=a,t[6]=r,t[7]=e,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l=(0,z.jsx)(B.Provider,{value:s,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}var J={maxLiveNodes:0,liveNodeBuffer:0,batchRendering:!1,deferNodesUntilVisible:!1,viewportPriority:!1,smoothStreaming:!1,typewriter:!1,fade:!1};H();var Y=e=>e===`tool`?`markdown-content markdown-tool oc-markstream-host`:e===`reasoning`?`markdown-content markdown-reasoning oc-markstream-host`:`markdown-content leading-relaxed oc-markstream-host`,X={overflow:`wrap`},Z=j.memo(({content:e,part:t,messageId:n,className:r,isStreaming:i=!1,variant:a=`assistant`,onShowPopup:o,enableFileReferences:s=!0})=>{let f=m()?.currentTheme.metadata.variant===`dark`,{editor:g,runtime:_}=h(),x=b()??``,S=j.useRef(null),C=t?.id?`oc-ms-${t.id}`:`oc-ms-${n}`,w=y(e,`markstream:${a}`),T=!i,E=s&&!i,D=E?{effectiveDirectory:x,editor:g,preferRuntimeEditor:_.isVSCode,onShowPopup:o}:void 0,O=j.useRef(T);O.current=T;let k=j.useRef(w);k.current=w;let A=l(e=>{if(!O.current)return;let t=e[0];if(!t)return;let n=t.borderBoxSize?.[0],r=n?n.blockSize:t.contentRect.height,i=n?n.inlineSize:t.contentRect.width;v(k.current,r,i)});d(S,A);let M=l(e=>{P(e,{onShowPopup:o,fileReference:D})}),N=l(e=>{F(e,{fileReference:D})});return u(`click`,M,S),u(`keydown`,N,S),(0,z.jsx)(`div`,{ref:S,className:p(`relative break-words w-full min-w-0`,Y(a),r),"data-markdown-ready":`true`,"data-markdown-hydration":`ready`,"data-oc-markdown-engine":`markstream`,"data-oc-markstream-virtual":`off`,children:(0,z.jsx)(U,{enabled:E,effectiveDirectory:x,editor:g,preferRuntimeEditor:_.isVSCode,onShowPopup:o,content:e,children:(0,z.jsx)(c,{content:e,customId:C,final:!i,isDark:f,codeBlockOptions:X,codeBlockStream:i,...J})})})},(e,t)=>e.content===t.content&&e.isStreaming===t.isStreaming&&e.disableStreamAnimation===t.disableStreamAnimation&&e.variant===t.variant&&e.isAnimated===t.isAnimated&&e.skipFadeIn===t.skipFadeIn&&e.className===t.className&&e.messageId===t.messageId&&e.onShowPopup===t.onShowPopup&&e.enableFileReferences===t.enableFileReferences&&e.part?.id===t.part?.id);export{Z as MarkstreamRenderer};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{E as t,w as n}from"./useUIStore-CqqO11ZI.js";import{kn as r,u as i}from"./persistence-CSZp1CNB.js";import{nt as a,rt as o}from"./vendor-base-ui-CnHfUmDN.js";import{n as s}from"./vendor-react-DLPElpoQ.js";import{s as c,t as l}from"./vendor-tanstack-react-query-D7pys_c9.js";import{Mo as u,No as d}from"./useMobileNavigationStore-DxH1DjU-.js";import{t as f}from"./utils-B0mQXN9L.js";import{n as p}from"./Icon-4My8YZwt.js";import{t as m}from"./button-Or0daT9o.js";var h=e(o(),1),g=s(),_=class extends Error{code;status;resource;constructor(e,t,n){super(e),this.code=e,this.status=t,this.resource=n}},v=class extends _{operation;constructor(e,t,n){super(e,t,`share_operation`),this.operation=n}},y=(e,t=200)=>{throw new _(`invalid_${e}_response`,t,e)},b=(e,t)=>e&&typeof e==`object`&&!Array.isArray(e)?e:y(t),x=(e,t)=>typeof e==`string`?e:y(t),S=(e,t)=>e===null||typeof e==`string`?e:y(t),C=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:y(t),w=(e,t)=>e===null?null:C(e,t),T=(e,t)=>typeof e==`boolean`?e:y(t),E=(e,t,n)=>t.includes(e)?e:y(n),D=e=>{let t=b(e,`capability`);return{supported:T(t.supported,`capability`),enabled:T(t.enabled,`capability`),revision:C(t.revision,`capability`),serverInstanceID:S(t.serverInstanceID,`capability`)}},O=e=>{let t=b(e,`assistant`),n=Array.isArray(t.historySessionIDs)?t.historySessionIDs.map(e=>x(e,`assistant`)):[],r=t.historySessionCount===void 0?n.length:C(t.historySessionCount,`assistant`);return!Number.isSafeInteger(r)||r<n.length?y(`assistant`):{id:x(t.id,`assistant`),revision:C(t.revision,`assistant`),enabled:T(t.enabled,`assistant`),name:x(t.name,`assistant`),defaultPrompt:x(t.defaultPrompt,`assistant`),workspacePath:S(t.workspacePath,`assistant`),effectiveWorkspacePath:x(t.effectiveWorkspacePath,`assistant`),managedWorkspacePath:S(t.managedWorkspacePath??null,`assistant`),providerID:x(t.providerID,`assistant`),modelID:x(t.modelID,`assistant`),agent:S(t.agent,`assistant`),variant:S(t.variant??null,`assistant`),mode:E(t.mode,[`continuous`,`stateless`],`assistant`),sessionID:S(t.sessionID,`assistant`),sessionGeneration:C(t.sessionGeneration,`assistant`),historySessionIDs:n,historySessionCount:r,createdAt:w(t.createdAt,`assistant`),updatedAt:C(t.updatedAt,`assistant`),tombstoneAt:w(t.tombstoneAt,`assistant`)}},k=e=>{let t=b(e,`snapshot`);return{revision:C(t.revision,`snapshot`),enabled:T(t.enabled,`snapshot`),assistants:Array.isArray(t.assistants)?t.assistants.map(O):y(`snapshot`)}},A=e=>{let t=b(e,`binding`);return{sessionID:S(t.sessionID,`binding`),directory:x(t.directory,`binding`),sessionGeneration:C(t.sessionGeneration,`binding`)}},j=e=>{let t=b(e,`compact`);return t.summarized===!0?{binding:A(t.binding),summarized:!0}:y(`compact`)},M=e=>{let t=b(e,`message_admission`);return t.admitted===!0?{binding:A(t.binding),messageID:x(t.messageID,`message_admission`),admitted:!0}:y(`message_admission`)},N=e=>{let t=b(e,`share_operation`);return{operationID:x(t.operationID,`share_operation`),assistantID:x(t.assistantID,`share_operation`),sessionID:S(t.sessionID,`share_operation`),messageID:S(t.messageID,`share_operation`),state:E(t.state,[`submitting`,`running`,`completed`,`failed`,`unresolved`],`share_operation`),phase:x(t.phase,`share_operation`),attempt:C(t.attempt,`share_operation`),leaseExpiresAt:w(t.leaseExpiresAt,`share_operation`),errorCode:S(t.errorCode,`share_operation`)}},P=e=>{let t=b(e,`assistant_history`),n=S(t.nextCursor,`assistant_history`),r=T(t.complete,`assistant_history`);return!r&&!n||r&&n||!Array.isArray(t.entries)?y(`assistant_history`):{entries:t.entries.map(e=>{let t=b(e,`assistant_history_entry`),n=x(t.sessionID,`assistant_history_entry`),r=b(t.info,`assistant_history_info`),i=b(r.time,`assistant_history_info`);if(x(r.id,`assistant_history_info`),x(r.sessionID,`assistant_history_info`)!==n||(E(r.role,[`user`,`assistant`,`system`,`tool`],`assistant_history_info`),C(i.created,`assistant_history_info`),!Array.isArray(t.parts)))return y(`assistant_history_entry`);let a=t.parts.map(e=>{let t=b(e,`assistant_history_part`);return x(t.id,`assistant_history_part`),x(t.sessionID,`assistant_history_part`)!==n||x(t.messageID,`assistant_history_part`)!==r.id?y(`assistant_history_part`):(x(t.type,`assistant_history_part`),t)});return{sessionID:n,directory:S(t.directory,`assistant_history_entry`),info:r,parts:a}}),nextCursor:n,complete:r}},F=30,I={snapshot:(e=t())=>[e,`assistants`,`snapshot`],capability:(e=t())=>[e,`assistants`,`capability`],history:(e,r,i,a=t(),o=n())=>[a,o,`assistants`,`history`,e,r,i]},L=(e,t,n)=>{if(!e||!t)return;let r=t.queryKey;if(r[0]===n.transport&&r[1]===n.runtimeGeneration&&r[2]===`assistants`&&r[3]===`history`&&r[4]===n.assistantID)return e},R=async(e,t={})=>{let n=await r(e,t),i=await n.json().catch(()=>null);if(!n.ok)throw new _(i&&typeof i==`object`&&`error`in i&&typeof i.error==`string`?i.error:`request_failed`,n.status);return i},z=(e,t)=>({method:e,headers:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)}),B=(e,r)=>{if(t()!==e||n()!==r)throw new _(`runtime_stale`,409)},V=(e,t,r)=>{i.setQueryData(I.snapshot(r),n=>n&&{...n,assistants:n.assistants.map(n=>n.id!==e||n.sessionGeneration>t.sessionGeneration?n:{...n,sessionID:t.sessionID,sessionGeneration:t.sessionGeneration,effectiveWorkspacePath:t.directory})}),i.invalidateQueries({queryKey:I.snapshot(r)}),i.invalidateQueries({queryKey:[r,n(),`assistants`,`history`,e]})},H=(e,t)=>{i.setQueryData(I.snapshot(t),t=>t&&{...t,assistants:t.assistants.some(t=>t.id===e.id)?t.assistants.map(t=>t.id===e.id?e:t):[...t.assistants,e]}),i.invalidateQueries({queryKey:I.snapshot(t)})},U=(e=t())=>({queryKey:I.snapshot(e),queryFn:async({signal:e})=>k(await R(`/api/openchamber/assistants/snapshot`,{signal:e})),retry:2}),W=()=>{let e=(0,g.c)(5),n,r,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=t(),n=c,r=U(a),e[0]=n,e[1]=r,e[2]=a):(n=e[0],r=e[1],a=e[2]);let o=n(r),s,l;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>d(e=>{if(t()!==a)return;if(e.type===`event-stream-ready`){i.invalidateQueries({queryKey:I.snapshot(a),exact:!0});return}if(e.type!==`assistants-changed`)return;let n=i.getQueryData(I.snapshot(a));(!n||e.revision>n.revision)&&i.invalidateQueries({queryKey:I.snapshot(a),exact:!0})}),l=[a],e[3]=s,e[4]=l):(s=e[3],l=e[4]),h.useEffect(s,l),o},G=(e,r,i,a=t(),o=n())=>({queryKey:I.history(e,r,i,a,o),queryFn:async({signal:t,pageParam:n})=>{B(a,o),await u(),B(a,o);let r=new URLSearchParams({limit:String(F)});n&&r.set(`before`,n);let i=P(await R(`/api/openchamber/assistants/${encodeURIComponent(e)}/messages?${r}`,{signal:t}));return B(a,o),i},initialPageParam:null,getNextPageParam:K,placeholderData:(t,n)=>L(t,n,{assistantID:e,transport:a,runtimeGeneration:o}),retry:2}),K=e=>e.complete?void 0:e.nextCursor??void 0,q=(e,t,n)=>{let r=(0,g.c)(7),i=n===void 0||n,a=t.sessionID??``,o;r[0]!==e||r[1]!==t.sessionGeneration||r[2]!==a?(o=G(e,a,t.sessionGeneration),r[0]=e,r[1]=t.sessionGeneration,r[2]=a,r[3]=o):o=r[3];let s=i&&!!(e&&t.sessionID),c;return r[4]!==o||r[5]!==s?(c={...o,enabled:s},r[4]=o,r[5]=s,r[6]=c):c=r[6],l(c)},J=async e=>k(await R(`/api/openchamber/assistants/snapshot`,{signal:e})),Y=(e=t())=>({queryKey:I.capability(e),queryFn:()=>Q(),retry:!1}),X=()=>{let e=(0,g.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Y(),e[0]=t):t=e[0],c(t)},Z=(e=i,n=t())=>e.getQueryData(I.snapshot(n)),ee=(e=i,n=t())=>e.fetchQuery(U(n)),te=async(e=i)=>{let r=t(),a=n();await e.invalidateQueries({queryKey:I.snapshot(r),exact:!0}),B(r,a);let o=await e.fetchQuery(U(r));return B(r,a),o},ne=async e=>{let r=t(),i=n();await u(),B(r,i);let a=A(await R(`/api/openchamber/assistants/${encodeURIComponent(e)}/session/ensure`,z(`POST`)));return B(r,i),V(e,a,r),a},re=async e=>{let r=t(),i=n(),a=A(await R(`/api/openchamber/assistants/${encodeURIComponent(e)}/session/new`,z(`POST`)));return B(r,i),V(e,a,r),a},ie=async(e,r)=>{let i=t(),a=n(),o=j(await R(`/api/openchamber/assistants/${encodeURIComponent(e)}/session/compact`,z(`POST`,{sessionID:r.sessionID,sessionGeneration:r.sessionGeneration})));return B(i,a),V(e,o.binding,i),o},ae=async(e,r)=>{let i=t(),a=n();await R(`/api/openchamber/assistants/${encodeURIComponent(e)}/session/abort`,z(`POST`,{sessionID:r.sessionID,sessionGeneration:r.sessionGeneration})),B(i,a)},oe=async(e,r,i,a,o=`composer`)=>{let s=t(),c=n(),l=M(await R(`/api/openchamber/assistants/${encodeURIComponent(e)}/messages`,z(`POST`,{sessionID:r.sessionID,sessionGeneration:r.sessionGeneration,messageID:i,parts:a,source:o})));return B(s,c),V(e,l.binding,s),l},se=async(e,r,i,a,o)=>{let s=t(),c=n(),l=N(await R(`/api/openchamber/assistants/${encodeURIComponent(e)}/share`,z(`POST`,{operationID:r,payload:{messageID:i,parts:a,source:o}})));return B(s,c),l},ce=async(e,r=t(),i=n())=>{B(r,i);let a=N(await R(`/api/openchamber/assistants/share-operations/${encodeURIComponent(e)}`));return B(r,i),a},le=async(e,r=t(),i=n())=>{let a=e;for(let e=0;e<60&&(a.state===`running`||a.state===`submitting`);e+=1)B(r,i),await new Promise(e=>setTimeout(e,750)),a=await ce(a.operationID,r,i);if(B(r,i),a.state===`completed`)return a;throw a.state===`failed`?new v(a.errorCode??`share_failed`,400,a):new v(`share_unresolved`,408,a)},ue=async(e,n)=>{await R(`/api/openchamber/assistants/settings`,z(`PUT`,{enabled:e,expectedRevision:n}));let r=t();await Promise.all([i.invalidateQueries({queryKey:I.snapshot(r),exact:!0}),i.invalidateQueries({queryKey:I.capability(r),exact:!0})])},de=async e=>{let n=t(),r=O(await R(`/api/openchamber/assistants`,z(`POST`,e)));return H(r,n),r},fe=async(e,r)=>{let i=t(),a=n(),o=O(await R(`/api/openchamber/assistants/${encodeURIComponent(e.id)}`,z(`PATCH`,{...r,expectedRevision:e.revision})));return B(i,a),H(o,i),o},pe=async e=>{await R(`/api/openchamber/assistants/${encodeURIComponent(e.id)}`,z(`DELETE`,{expectedRevision:e.revision})),await i.invalidateQueries({queryKey:I.snapshot(t())})},Q=async()=>D(await R(`/api/openchamber/assistants/capability`)),$=a();function me(e){let t=(0,g.c)(32),{title:n,subtitle:r,backAriaLabel:i,onBack:a,backDisabled:o,actions:s,trailing:c,sticky:l,overlay:u,elevated:d}=e,h=o!==void 0&&o,_;t[0]===s?_=t[1]:(_=s===void 0?[]:s,t[0]=s,t[1]=_);let v=_,y=l!==void 0&&l,b=u!==void 0&&u,x=d!==void 0&&d,S=!!c||v.length>0,C=x||v.some(ge),w=y&&`oc-mobile-detail-navigation-sticky`,T=b&&`absolute inset-x-0 top-0`,E=C?`z-[60]`:b?`z-30`:void 0,D;t[2]!==w||t[3]!==T||t[4]!==E?(D=f(`oc-mobile-detail-navigation relative shrink-0 pt-[max(0.25rem,var(--oc-safe-area-top,0px))]`,w,T,E),t[2]=w,t[3]=T,t[4]=E,t[5]=D):D=t[5];let O=S&&v.length+ +!!c>1?`grid-cols-[2.75rem_minmax(0,1fr)_auto]`:`grid-cols-[2.75rem_minmax(0,1fr)_2.75rem]`,k;t[6]===O?k=t[7]:(k=f(`oc-mobile-detail-navigation-content grid items-center gap-1 px-4`,O),t[6]=O,t[7]=k);let A;t[8]!==i||t[9]!==h||t[10]!==a?(A=a?(0,$.jsx)(m,{type:`button`,variant:`mobileGlass`,size:`mobileIcon`,className:`justify-self-start`,onClick:a,disabled:h,"aria-label":i,children:(0,$.jsx)(p,{name:`arrow-left-s`,className:`size-5`})}):(0,$.jsx)(`span`,{"aria-hidden":`true`}),t[8]=i,t[9]=h,t[10]=a,t[11]=A):A=t[11];let j;t[12]===n?j=t[13]:(j=(0,$.jsx)(`div`,{className:`oc-mobile-detail-title w-full truncate typography-ui-label font-medium text-foreground`,children:n}),t[12]=n,t[13]=j);let M;t[14]===r?M=t[15]:(M=r?(0,$.jsx)(`div`,{className:`oc-mobile-detail-subtitle w-full truncate text-muted-foreground`,"aria-live":`polite`,children:r}):null,t[14]=r,t[15]=M);let N;t[16]!==j||t[17]!==M?(N=(0,$.jsxs)(`div`,{className:`flex w-full max-w-72 min-w-0 flex-col items-center justify-center justify-self-center px-1`,children:[j,M]}),t[16]=j,t[17]=M,t[18]=N):N=t[18];let P;t[19]===v?P=t[20]:(P=v.map(he),t[19]=v,t[20]=P);let F;t[21]!==P||t[22]!==c?(F=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-2`,children:[c,P]}),t[21]=P,t[22]=c,t[23]=F):F=t[23];let I;t[24]!==k||t[25]!==A||t[26]!==N||t[27]!==F?(I=(0,$.jsxs)(`div`,{className:k,children:[A,N,F]}),t[24]=k,t[25]=A,t[26]=N,t[27]=F,t[28]=I):I=t[28];let L;return t[29]!==D||t[30]!==I?(L=(0,$.jsx)(`header`,{className:D,children:I}),t[29]=D,t[30]=I,t[31]=L):L=t[31],L}function he(e,t){return(0,$.jsx)(m,{type:`button`,variant:`mobileGlass`,size:`mobileIcon`,className:f(e.elevated&&`relative z-[60]`),onClick:e.onClick,disabled:e.disabled,"aria-label":e.ariaLabel,"aria-expanded":e.pressed,title:e.title,children:(0,$.jsx)(p,{name:e.icon,className:`size-5`})},`${e.icon}:${t}`)}function ge(e){return e.elevated}export{v as S,X as _,pe as a,le as b,Q as c,re as d,Z as f,fe as g,ue as h,de as i,J as l,se as m,ae as n,ne as o,oe as p,ie as r,ee as s,me as t,te as u,q as v,_ as x,W as y};
@@ -0,0 +1,4 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/rolldown-runtime-C0FnF6B9.js","assets/useAssistantUIStore-BHacrxe_.js","assets/useUIStore-CqqO11ZI.js","assets/vendor-zustand-B4dlGEM2.js","assets/vendor-base-ui-CnHfUmDN.js"])))=>i.map(i=>d[i]);
2
+ import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{A as n,C as r,E as i,Q as a,T as o,X as s,j as c,q as l,w as u}from"./useUIStore-CqqO11ZI.js";import{Ot as d,bt as f,et as p,kn as m,nt as h,yt as g}from"./persistence-CSZp1CNB.js";import{nt as _,rt as v}from"./vendor-base-ui-CnHfUmDN.js";import{n as y,r as b}from"./platform-CenlWqxu.js";import{a as ee,n as x,o as te,t as ne}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";import{n as re}from"./vendor-react-DLPElpoQ.js";import{n as S}from"./vendor-reactuses-core-DDoDDyM9.js";import{n as ie}from"./clipboard-Bu0lpyX1.js";import{ko as C,r as ae}from"./useMobileNavigationStore-DxH1DjU-.js";import{S as oe,b as se,c as w,m as ce,s as le,t as ue,u as de}from"./MobileDetailNavigation-Dcl7Upvc.js";import{i as T,n as fe}from"./useAssistantUIStore-BHacrxe_.js";import{n as pe,t as me}from"./dialog-D21YndEx.js";import{t as he}from"./AgentAvatar-Dp_hbVcD.js";import{n as ge}from"./Icon-4My8YZwt.js";var _e=re(),E=e(v(),1),ve=`openchamber.mobile.connections.v1`,ye=`openchamber.mobile.`,be=`openchamber.mobile.deviceId`,xe=()=>{try{let e=window.localStorage.getItem(be);if(e&&e.trim())return e.trim();let t=p();return window.localStorage.setItem(be,t),t}catch{return p()}},Se=()=>`mobile:${xe()}`,Ce=()=>{try{let e=x.getPlatform();return e===`ios`||e===`android`?e:void 0}catch{return}},we=12,Te=8e3,Ee=2500,De=3e3,Oe=2500,D=e=>{let t=e.trim();if(!t)return``;let n=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(n);return r.hash=``,r.search=``,r.pathname=r.pathname.replace(/\/+$/,``),r.toString().replace(/\/+$/,``)},ke=e=>{try{return new URL(e).host}catch{return e}},O=e=>{try{return D(e)}catch{return e.trim().replace(/\/+$/g,``)}},Ae=(e,t)=>O(e)===O(t),je=e=>`relay:${e.serverId}@${e.relayUrl.trim()}`,Me=e=>`relay://${e.serverId}`,Ne=e=>e.candidates.filter(e=>e.kind===`direct`),k=e=>{let t=e.candidates.find(e=>e.kind===`relay`);return t&&t.kind===`relay`?t.relay:null},A=e=>{let t=Ne(e)[0];if(t)return t.url;let n=k(e);return n?Me(n):``},j=e=>{let t=k(e);if(t)return je(t);let n=Ne(e)[0];return n?O(n.url):``},Pe=j,Fe=(e,t)=>{let n=e.find(e=>e.kind===`relay`),r=n&&n.kind===`relay`?n.relay.serverId:null,i=n&&n.kind===`relay`?n.relay.relayUrl.trim():null,a=new Set(e.filter(e=>e.kind===`direct`).map(e=>O(e.url)));return t.some(e=>e.kind===`relay`?r!==null&&e.relay.serverId===r&&e.relay.relayUrl.trim()===i:a.has(O(e.url)))},Ie=(e,t)=>t.id&&e.id===t.id?!0:Fe(e.candidates,t.candidates),Le=e=>{let t=(()=>{try{return D(e)}catch{return``}})();return t?[{kind:`direct`,url:t}]:[]},Re=e=>{if(e.candidates&&e.candidates.length>0)return e.candidates;let t=[];return typeof e.url==`string`&&e.url.trim()&&!/^relay:\/\//i.test(e.url.trim())&&t.push(...Le(e.url)),e.relay&&t.push({kind:`relay`,relay:e.relay}),t},ze=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(typeof t.relayUrl!=`string`||!t.relayUrl.trim()||typeof t.serverId!=`string`||!t.serverId.trim())return null;let n=t.hostEncPubJwk;if(!n||typeof n!=`object`||Array.isArray(n))return null;let r=n;return r.kty!==`EC`||r.crv!==`P-256`||typeof r.x!=`string`||!r.x||typeof r.y!=`string`||!r.y?null:{relayUrl:t.relayUrl,serverId:t.serverId,hostEncPubJwk:{kty:`EC`,crv:`P-256`,x:r.x,y:r.y}}},M=e=>{try{return JSON.stringify(e)}catch{return String(e)}},N=(e,t={})=>{M(t)},P=(e,t={})=>{M(t)},Be=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}},Ve=e=>{if(typeof e!=`string`)return e??void 0;try{return JSON.parse(e)}catch{return e}},He=async(e,t)=>{if(!y())return null;try{let{CapacitorHttp:n}=await te(async()=>{let{CapacitorHttp:e}=await import(`./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js`).then(e=>e.i);return{CapacitorHttp:e}},__vite__mapDeps([0,1])),r=Object.fromEntries(new Headers(t?.headers).entries()),i=await n.request({url:e,method:t?.method||`GET`,headers:r,data:Ve(t?.body)});return{ok:i.status>=200&&i.status<300,status:i.status,source:`native-http`,json:async()=>Be(i.data)}}catch(t){return console.warn(`[mobile-connect]`,`native-http failed`,M({url:e,error:t instanceof Error?t.message:String(t)})),null}},Ue=async(e,t)=>{let n=await fetch(e,t).catch(t=>(console.warn(`[mobile-connect]`,`browser-fetch failed`,M({url:e,error:t instanceof Error?t.message:String(t)})),null));return n?{ok:n.ok,status:n.status,source:`browser-fetch`,json:()=>n.json()}:null},F=async(e,t,n)=>{let r,i=new Promise(t=>{r=window.setTimeout(()=>{n?.(),t(null)},e)});try{return await Promise.race([t,i])}catch{return null}finally{r!==void 0&&window.clearTimeout(r)}},I=async(e,t,n)=>{let r=n?.totalTimeoutMs??Te,i=Date.now(),a=await F(Math.min(Ee,r),He(e,t));if(a)return a;let o=new AbortController;return F(Math.max(500,r-(Date.now()-i)),Ue(e,{...t,signal:o.signal}),()=>o.abort())},We=async e=>{if(!e)return null;let t=await e.json().catch(()=>null);if(!t||typeof t!=`object`)return null;let n=t;return{authenticated:typeof n.authenticated==`boolean`?n.authenticated:void 0,disabled:typeof n.disabled==`boolean`?n.disabled:void 0,scope:typeof n.scope==`string`?n.scope:void 0}},L=15e3,Ge=async(e,t,n,r=L,i)=>{let o=a({relayUrl:e.relayUrl,serverId:e.serverId,hostEncPubJwk:e.hostEncPubJwk,...n?{grant:n}:{}}),s=e=>e===`ok`&&i?.keepTunnel?{outcome:e,tunnel:o}:(o.close(),{outcome:e});try{let e=t?{Authorization:`Bearer ${t}`}:void 0,n=await F(r,o.fetch(`/auth/session`,{headers:e}).catch(()=>null));if(N(`relay:session`,{ok:n?.ok===!0,status:n?.status??null,hasToken:!!t}),!n)return s(`unreachable`);if(n.status===401)return s(t?`auth-failed`:`needs-login`);if(!n.ok&&n.status!==404)return s(`auth-failed`);let i=await We(n);return i&&i.disabled!==!0&&i.authenticated===!1?s(t?`auth-failed`:`needs-login`):s(`ok`)}catch(e){throw o.close(),e}},Ke=(e,t,n,r,i)=>{let a=typeof window<`u`?window.location.origin:``,o={relayUrl:e.relayUrl,serverId:e.serverId,hostEncPubJwk:e.hostEncPubJwk,...n?{grant:n}:{}};i&&l(o,i),c({apiBaseUrl:a,clientToken:t,runtimeKey:r??je(e),relay:o})},qe=e=>{if(!e||typeof e!=`object`)return null;let t=e;if(t.kind===`direct`)return typeof t.url==`string`&&t.url.trim()?{kind:`direct`,url:t.url}:null;if(t.kind===`relay`){let e=ze(t.relay);return e?{kind:`relay`,relay:e}:null}return null},Je=e=>{if(e.mode===`relay`){let t=ze(e.relay);return t?[{kind:`relay`,relay:t}]:[]}return typeof e.url==`string`?Le(e.url):[]},R=()=>{if(typeof window>`u`)return[];let e;try{e=JSON.parse(window.localStorage.getItem(ve)||`[]`)}catch{return[]}if(!Array.isArray(e))return[];let t=y();return e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let n=e;if(typeof n.id!=`string`)return[];let r=Array.isArray(n.candidates)?n.candidates.map(qe).filter(e=>!!e):Je(n);if(r.length===0)return[];let i=typeof n.clientToken==`string`&&n.clientToken.trim()?n.clientToken:void 0,a=typeof n.label==`string`&&n.label.trim()?n.label:ke(A({candidates:r})),o={id:n.id,label:a,candidates:r,lastUsedAt:typeof n.lastUsedAt==`number`?n.lastUsedAt:0};return t?[{...o,hasToken:!!n.hasToken||!!i}]:[{...o,clientToken:i,hasToken:!!i}]}).sort((e,t)=>t.lastUsedAt-e.lastUsedAt)},Ye=e=>e.kind===`relay`?{kind:`relay`,relay:{relayUrl:e.relay.relayUrl,serverId:e.relay.serverId,hostEncPubJwk:e.relay.hostEncPubJwk}}:{kind:`direct`,url:e.url},Xe=e=>{if(typeof window>`u`)return;let t=y(),n=e.slice(0,we).map(e=>{let n={id:e.id,label:e.label,candidates:e.candidates.map(Ye),lastUsedAt:e.lastUsedAt};return t?{...n,hasToken:!!(e.hasToken||e.clientToken)}:{...n,clientToken:e.clientToken}});try{window.localStorage.setItem(ve,JSON.stringify(n))}catch(e){console.warn(`[mobile-storage] failed to persist connection metadata`,e)}},Ze=(e,t)=>{let n=e.find(e=>Ie(e,t)),r=y(),i={id:t.id||n?.id||p(),label:t.label,candidates:t.candidates,lastUsedAt:Date.now(),...r?{hasToken:t.hasToken??(!!t.clientToken||n?.hasToken||!1)}:{clientToken:t.clientToken??n?.clientToken,hasToken:!!(t.clientToken??n?.clientToken)}};return[i,...e.filter(e=>e.id!==i.id&&!Ie(e,t))].slice(0,we)},Qe=ne,$e=0,et=e=>`${ye}token.${encodeURIComponent(e)}`,tt=async(e,t)=>{let n,r=new Promise(e=>{n=window.setTimeout(()=>e(t),De)});try{return await Promise.race([e.catch(()=>t),r])}finally{n!==void 0&&window.clearTimeout(n)}},nt=async(e,t,n)=>y()?tt(t().catch(t=>(console.warn(`[mobile-storage] ${e} failed`,t),n)),n):n,z=async e=>{P(`secure:read-start`,{key:e});let t=await nt(`secure:read`,async()=>(await Qe.internalGetItem({prefixedKey:et(e),sync:!1})).data,null),n=typeof t==`string`&&t.trim()?t:void 0;return P(`secure:read`,{key:e,hasToken:!!n}),n},B=async(e,t)=>{P(`secure:write-start`,{key:e});let n=await nt(`secure:write`,async()=>(await Qe.internalSetItem({prefixedKey:et(e),data:t,sync:!1,access:$e}),!0),!1);return P(`secure:write`,{key:e,ok:n}),n},rt=async e=>{await nt(`secure:delete`,async()=>(await Qe.internalRemoveItem({prefixedKey:et(e),sync:!1}),!0),!1)},it=async()=>{if(typeof window>`u`||!y())return;let e;try{e=JSON.parse(window.localStorage.getItem(ve)||`[]`)}catch{return}if(!Array.isArray(e))return;let t=e.filter(e=>!!e&&typeof e==`object`&&typeof e.url==`string`&&typeof e.clientToken==`string`&&!!e.clientToken.trim());if(t.length!==0){P(`secure:migrate-start`,{count:t.length});for(let{url:e,clientToken:n}of t)await B(O(e),n);Xe(R()),P(`secure:migrate-done`,{count:t.length})}},at=async()=>(await it(),R()),V=async e=>{let t=Ze(R(),e);if(Xe(t),y()&&e.clientToken){let n=t[0];n&&await B(j(n),e.clientToken)}return t},ot=async e=>{let t=R(),n=t.find(t=>t.id===e)??null,r=t.filter(t=>t.id!==e);if(Xe(r),n&&y()&&await rt(j(n)),n){let e=j(n),{useAssistantUIStore:t}=await te(async()=>{let{useAssistantUIStore:e}=await import(`./useAssistantUIStore-BHacrxe_.js`).then(e=>e.a);return{useAssistantUIStore:e}},__vite__mapDeps([2,1,3,4,5]));t.getState().removeCatalogPartition(e);let{publishNativeAssistantCatalog:r}=await te(async()=>{let{publishNativeAssistantCatalog:e}=await Promise.resolve().then(()=>tn);return{publishNativeAssistantCatalog:e}},void 0);await r().catch(()=>void 0)}return r},st=1500,H=async(e,t,n)=>{let r=n?.fast?{totalTimeoutMs:Oe}:void 0,i=k({candidates:e})?.serverId??null,a=e.find(e=>e.kind===`relay`)??null,o=e.filter(e=>e.kind===`direct`),s=async()=>{for(let e of o){let n=D(e.url)||e.url,a=t?{Authorization:`Bearer ${t}`}:void 0,o=await I(`${n}/health`,{method:`GET`},r);if(!o?.ok)continue;if(i){let e=await o.json().catch(()=>null),t=e&&typeof e==`object`?e.serverId:null;if(typeof t==`string`&&t&&t!==i){N(`probe:server-id-mismatch`,{url:n});continue}}let s=await I(`${n}/auth/session`,{method:`GET`,credentials:`include`,headers:a},r);if(s?.status===401)return{status:`needs-login`};if(!s||!s.ok&&s.status!==404)continue;let c=await We(s);if(c&&c.disabled!==!0&&c.authenticated===!1)return{status:`needs-login`};let l=c?.disabled===!0;return!t&&y()&&!l&&c?.scope!==`client`?{status:`needs-login`}:{status:`ok`,transport:{kind:`direct`,url:n}}}return{status:`unreachable`}},c=async()=>{if(!a)return{status:`unreachable`};let{outcome:e,tunnel:r}=await Ge(a.relay,t,void 0,n?.fast?Oe:void 0,{keepTunnel:!0});return e===`ok`?{status:`ok`,transport:{kind:`relay`,relay:a.relay,tunnel:r}}:e===`needs-login`||e===`auth-failed`?{status:`needs-login`}:{status:`unreachable`}};return a?o.length===0?c():new Promise(e=>{let t=!1,n=!1,r,i=null,a=null,o=e=>{e?.status===`ok`&&e.transport.kind===`relay`&&e.transport.tunnel?.close()},l=n=>{t||(t=!0,e(n))},u=()=>{n||t||(r!==void 0&&(window.clearTimeout(r),r=void 0),c().then(e=>{if(a=e,t||n){o(e);return}if(e.status===`ok`||e.status===`needs-login`){l(e);return}i&&l(i)}))};s().then(e=>{if(i=e,!t){if(e.status===`ok`||e.status===`needs-login`){n=!0,r!==void 0&&window.clearTimeout(r),o(a),l(e);return}if(a){l(a);return}u()}}),r=window.setTimeout(u,st)}):s()},U=(e,t,n)=>{e.kind===`relay`?Ke(e.relay,t,n?.grant,n?.runtimeKey,e.tunnel):c({apiBaseUrl:e.url,clientToken:t,runtimeKey:n?.runtimeKey}),St()},ct=()=>{let e=R()[0];return e?.label?.trim()?e.label:null},lt=async()=>{await it();let e=R()[0];if(!e)return!1;let t;if(y()){if(!e.hasToken||(t=await z(j(e)),!t))return!1}else if(t=e.clientToken,!t)return!1;let n=await H(e.candidates,t);return n.status===`ok`&&(await V({id:e.id,label:e.label,candidates:e.candidates}),U(n.transport,t,{runtimeKey:j(e)}),!0)},ut=async(e,t)=>{let n=(await at()).find(t=>j(t)===e);if(!n)return`missing`;let r=y()?n.hasToken?await z(e):void 0:n.clientToken;if(!r)return`auth-required`;let i=t?.transportPreference===`relay`?n.candidates.filter(e=>e.kind===`relay`):n.candidates;if(i.length===0)return`offline`;let a=await H(i,r,{fast:!0});return a.status===`needs-login`?`auth-required`:a.status===`ok`?(U(a.transport,r,{runtimeKey:e}),`connected`):`offline`},dt=async(e,t)=>{let n=``;try{n=D(e.url)}catch{return!1}if(!n)return!1;let r=e.clientToken?.trim()||void 0,i=r?{Authorization:`Bearer ${r}`}:void 0,a=t?.fast?{totalTimeoutMs:Oe}:void 0;if(!(await I(`${n}/health`,{method:`GET`,headers:i},a))?.ok)return!1;let o=await I(`${n}/auth/session`,{method:`GET`,credentials:`include`,headers:i},a);if(!o||!o.ok&&o.status!==404)return!1;let s=await We(o);return!(s&&s.disabled!==!0&&s.authenticated===!1)},ft=e=>[...e].sort((e,t)=>{let n=(e.priority??100)-(t.priority??100);if(n!==0)return n;let r=e=>e.type===`relay`?2:+!e.url.startsWith(`https://`);return r(e)-r(t)}).flatMap(e=>{if(e.type===`relay`){let t=ze({relayUrl:e.relayUrl,serverId:e.serverId,hostEncPubJwk:e.hostEncPubJwk});return t?[{kind:`relay`,relay:t}]:[]}return Le(e.url)}),pt=async e=>{let t=k({candidates:e})?.serverId??null;for(let n of e){if(n.kind===`relay`){let e=a(n.relay),t=await F(L,e.fetch(`/health`).catch(()=>null));if(N(`establish:relay:health`,{ok:t?.ok===!0,status:t?.status??null}),t?.ok)return{kind:`relay`,relay:n.relay,tunnel:e};e.close();continue}let e=D(n.url)||n.url,r=await I(`${e}/health`,{method:`GET`});if(N(`establish:direct:health`,{ok:r?.ok===!0,status:r?.status??null}),r?.ok){if(t){let n=await r.json().catch(()=>null),i=n&&typeof n==`object`?n.serverId:null;if(typeof i==`string`&&i&&i!==t){N(`establish:server-id-mismatch`,{url:e});continue}}return{kind:`direct`,url:e}}}return null},mt=async(e,t)=>{if(!s())return dt(e,t);let n=await F(t?.fast?Oe:L,m(`/auth/session`).then(e=>e).catch(()=>null));if(!n)return!0;if(n.status===401)return!1;if(!n.ok&&n.status!==404)return!0;let r=await We(n);return!(r&&r.disabled!==!0&&r.authenticated===!1)},ht=e=>e.kind===`relay`?s():!s()&&Ae(e.url,r()),gt=()=>{let e=o();return e?R().find(t=>j(t)===e)??null:null},_t=e=>{let t=o();return!!t&&j(e)===t},vt=async()=>{let e=gt();if(!e)return`no-connection`;let t;if(t=y()?e.hasToken?await z(j(e)):void 0:e.clientToken,!t)return`unreachable`;let n=e.candidates.findIndex(e=>ht(e.kind===`relay`?{kind:`relay`,relay:e.relay}:{kind:`direct`,url:e.url})),i=await H(n>=0?e.candidates.slice(0,n):e.candidates,t,{fast:!0});if(i.status===`ok`)return await V({id:e.id,label:e.label,candidates:e.candidates}),U(i.transport,t,{runtimeKey:j(e)}),`switched`;if(i.status===`needs-login`)return`unreachable`;if(n>=0&&await mt({url:r(),clientToken:t},{fast:!0}))return St(),`unchanged`;let a=await H(n>=0?e.candidates.slice(n+1):[],t,{fast:!0});return a.status===`ok`?(await V({id:e.id,label:e.label,candidates:e.candidates}),U(a.transport,t,{runtimeKey:j(e)}),`switched`):`unreachable`},yt=5e3,bt=!1,xt=async()=>{if(bt)return`skipped`;let e=gt();if(!e)return N(`candidates:refresh-skip`,{reason:`no-active-connection`}),`skipped`;let t=k(e);if(!t)return N(`candidates:refresh-skip`,{reason:`no-relay-candidate`}),`skipped`;bt=!0;try{let n=await F(L,m(`/api/client-auth/connection/candidates`).then(e=>e).catch(()=>null));if(!n?.ok)return N(`candidates:refresh-skip`,{reason:`fetch-failed`,status:n?.status??null}),`skipped`;let r=await n.json().catch(()=>null);if(!r||r.serverId!==t.serverId)return N(`candidates:refresh-skip`,{reason:`server-id-mismatch`}),`skipped`;let i=Array.isArray(r.candidates)?r.candidates:[],a=[];for(let e of i){if(!e||typeof e!=`object`)continue;let t=e;if(t.type===`lan`&&typeof t.url==`string`)try{let e=D(t.url);e&&!a.includes(e)&&a.push(e)}catch{}}if(a.length===0)return N(`candidates:refresh-skip`,{reason:`no-lan-reported`}),`skipped`;let o=Ne(e).filter(e=>e.url.startsWith(`https://`)),s=[...a.map(e=>({kind:`direct`,url:e})),...o,{kind:`relay`,relay:t}];return JSON.stringify(e.candidates.map(Ye))===JSON.stringify(s.map(Ye))?`unchanged`:(N(`candidates:refreshed`,{lanCount:a.length}),await V({id:e.id,label:e.label,candidates:s}),`updated`)}finally{bt=!1}},St=()=>{typeof window>`u`||window.setTimeout(()=>{(async()=>{let e=await xt().catch(()=>`skipped`);N(`candidates:refresh-result`,{result:e}),e===`updated`&&s()&&await vt().catch(()=>null)})()},yt)},Ct=e=>{let{t}=ie(),[n,r]=E.useState(()=>R()),[i,a]=E.useState(null),[o,s]=E.useState(null),[c,l]=E.useState(null),u=E.useRef(n),d=E.useRef(null),f=E.useRef(new Set),m=S(()=>{e(),f.current.forEach(e=>e())}),h=S(e=>(f.current.add(e),()=>f.current.delete(e))),g=S(e=>{u.current=e,r(e)}),_=S(e=>{d.current=e,a(e)}),v=S(e=>{d.current===e&&(d.current=null,a(null))});E.useEffect(()=>{let e=!1;return at().then(t=>{e||g(t)}),()=>{e=!0}},[g]);let b=S(e=>{let t=Ze(u.current,e);return g(t),Xe(t),t}),ee=S(async e=>{s(null),_(`connect`);try{let n=Re(e);if(n.length===0){s(t(`mobile.connect.error.urlRequired`));return}let r=e.id?u.current.find(t=>t.id===e.id):u.current.find(e=>Fe(e.candidates,n)),i=e.label?.trim()||r?.label||ke(A({candidates:n})),a=e.relayGrant,o=e.clientToken?.trim()||void 0,c=!!o;o||(y()?r?.hasToken&&(o=await z(j(r))):o=r?.clientToken),N(`connect:start`,{candidates:n.map(e=>e.kind),hasToken:!!o});let d=await H(n,o);if(N(`connect:probe`,{status:d.status}),d.status===`unreachable`){s(t(`mobile.connect.error.unreachable`));return}if(d.status===`needs-login`){b({id:r?.id,label:i,candidates:n}),l({id:r?.id??p(),label:i,candidates:n,relay:k({candidates:n})??void 0,relayGrant:a});return}let f=j({candidates:n});o&&c&&y()&&await B(f,o),b({id:r?.id,label:i,candidates:n,clientToken:o}),U(d.transport,o??null,{runtimeKey:f,grant:a}),m()}catch(e){console.warn(`[mobile-connect] connect threw`,e),s(t(`mobile.connect.error.invalidUrl`))}finally{v(`connect`)}}),x=S(async e=>{if(d.current===`pairing`)return;s(null),_(`pairing`);let n=ft(e.candidates),r=null,i=!1;try{if(r=await pt(n),!r){s(t(`mobile.connect.error.unreachable`));return}let a={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({pairingId:e.pairingId,secret:e.secret,clientLabel:`OpenChamber Mobile`,clientKind:`mobile`,deviceName:`OpenChamber Mobile`,devicePlatform:Ce(),dedupeKey:Se()})},o=r.kind===`relay`?await F(L,r.tunnel.fetch(`/api/client-auth/pairing/redeem`,a).catch(()=>null)):await I(`${r.url}/api/client-auth/pairing/redeem`,a);if(!o?.ok){s(t(`mobile.connect.error.authRequired`));return}let c=await o.json().catch(()=>null),l=typeof c?.clientToken==`string`?c.clientToken.trim():``;if(!l){s(t(`mobile.connect.error.authRequired`));return}let u=typeof c?.server?.label==`string`?c.server.label:``,d=e.label||u||ke(A({candidates:n})),f=j({candidates:n});if(y()&&!await B(f,l)){s(t(`mobile.connect.error.authRequired`));return}b({label:d,candidates:n,clientToken:l}),U(r.kind===`relay`?{kind:`relay`,relay:r.relay,tunnel:r.tunnel}:{kind:`direct`,url:r.url},l,{runtimeKey:f}),i=r.kind===`relay`,m()}catch(e){console.warn(`[mobile-connect] pairing threw`,e),s(t(`mobile.connect.error.authRequired`))}finally{!i&&r?.kind===`relay`&&r.tunnel.close(),v(`pairing`)}}),te=S(async e=>{if(!c||!e.trim()||d.current===`password`)return;s(null),_(`password`);let{id:n,label:r,candidates:i}=c,a=null,o=!1;try{if(a=await pt(i),!a){s(t(`mobile.connect.error.unreachable`));return}let c={method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({password:e,trustDevice:!0,issueClientToken:!0,clientLabel:`OpenChamber Mobile`,clientKind:`mobile`,devicePlatform:Ce(),dedupeKey:Se()})};N(`password:start`,{transport:a.kind});let u=a.kind===`relay`?await F(L,a.tunnel.fetch(`/auth/session`,c).catch(()=>null)):await I(`${a.url}/auth/session`,c);if(N(`password:done`,{ok:u?.ok===!0,status:u?.status??null}),!u?.ok){s(t(`mobile.connect.error.passwordFailed`));return}let d=await u.json().catch(()=>null),f=typeof d?.clientToken==`string`?d.clientToken.trim():``;if(N(`password:token`,{issued:!!f}),!f){if(a.kind===`direct`&&!y()){b({id:n,label:r,candidates:i}),l(null),U({kind:`direct`,url:a.url},null,{runtimeKey:j({candidates:i})}),m();return}s(t(`mobile.connect.error.authRequired`));return}y()&&await B(j({candidates:i}),f),b({id:n,label:r,candidates:i,clientToken:f}),l(null),U(a.kind===`relay`?{kind:`relay`,relay:a.relay,tunnel:a.tunnel}:{kind:`direct`,url:a.url},f,{runtimeKey:j({candidates:i})}),o=a.kind===`relay`,m()}catch(e){console.warn(`[mobile-connect] password threw`,e),s(t(`mobile.connect.error.passwordFailed`))}finally{!o&&a?.kind===`relay`&&a.tunnel.close(),v(`password`)}}),ne=S(()=>{l(null),s(null)}),re=S(async e=>{s(null);let n=Re(e),r=e.id?u.current.find(t=>t.id===e.id)??null:null;if(r){let e=n.filter(e=>e.kind===`direct`),t=Ne(r).filter(t=>t.url.startsWith(`https://`)&&!e.some(e=>Ae(e.url,t.url))),i=k(r);n=[...e,...t,...i?[{kind:`relay`,relay:i}]:[]]}if(n.length===0)return s(t(`mobile.connect.error.urlRequired`)),null;let i=e.clientToken?.trim()||void 0,a=e.label?.trim()||ke(A({candidates:n}));if(y()){let e=j({candidates:n});if(i)await B(e,i);else if(r?.hasToken){let t=j(r);if(t&&e&&t!==e){let n=await z(t);n&&await B(e,n)}}}return b({id:e.id,label:a,candidates:n,clientToken:i}).find(e=>Fe(e.candidates,n))??null}),C=S(async e=>{let t=u.current.find(t=>t.id===e)??null,n=await ot(e);return g(n),t});return{connections:n,isBusy:i!==null,isPasswordBusy:i===`password`,error:o,pendingConnection:c,connect:ee,redeemPairingConnection:x,submitPassword:te,cancelPassword:ne,saveConnection:re,removeConnection:C,subscribeConnected:h,setError:s}},wt=async(e,t=3)=>{let n;for(let r=0;r<t;r+=1)try{await e();return}catch(e){n=e}throw n},Tt=async(e,t,n=2)=>{let r=[...new Map(e.map(e=>[e.operationID,e])).values()],i=0;await Promise.all(Array.from({length:Math.min(Math.max(1,n),r.length)},async()=>{for(;i<r.length;){let e=r[i++];try{e.cleanupPhase&&e.cleanupPhase!==`files-released`?await t.cleanup(e.operationID):await t.deliver(e.operationID)}catch{}}}))},Et=e=>!!(e.serverInstanceID&&e.assistantID&&e.name&&e.avatarSeed&&e.serverLabel&&e.connectionKey),Dt=`openchamber.mobile-share.draft-handoff.v1`,Ot=`mobile-share-handoff:`,kt=20971520,At=20971520,jt=e=>`${Ot}${e}`,Mt=e=>typeof e.partID==`string`&&e.partID.startsWith(`mobile-share-handoff:`),Nt=e=>e??(typeof window>`u`?null:window.localStorage),W=e=>{if(!e)return{};try{let t=JSON.parse(e.getItem(`openchamber.mobile-share.draft-handoff.v1`)||`{}`);return Object.fromEntries(Object.entries(t).flatMap(([e,t])=>{let n=typeof t.assistantID==`string`?t.assistantID:Bt(t),r=typeof t.transportIdentity==`string`?t.transportIdentity:t.targetDraftKey?.transportIdentity;if(!n||typeof t.serverInstanceID!=`string`||typeof t.connectionKey!=`string`||!r)return[];let i=t.phase===`cancelled`?`cancelled`:t.phase===`materialized`?`materialized`:`materializing`;return[[e,{...t,draftID:e,assistantID:n,transportIdentity:r,phase:i}]]}))}catch{return{}}},Pt=(e,t)=>{if(!e)return!1;try{return e.setItem(Dt,JSON.stringify(t)),!0}catch{return!1}},Ft=(e,t)=>{let n=W(e);if(delete n[t],e)try{e.setItem(Dt,JSON.stringify(n))}catch{return}},G=(e,t)=>Pt(e,{...W(e),[t.draftID]:t}),It=(e,t)=>`native-share:${e}:${t}`,Lt=(e,t)=>t?e?`${e}\n\n${t}`:t:e,Rt=e=>e.mime.startsWith(`image/`)&&e.byteSize>0&&e.byteSize<=kt,zt=(e,t)=>!!t?.syntheticParts.some(t=>t.partID===jt(e.draftID)&&t.text===``&&t.attachments.length===0&&t.synthetic===!0),Bt=e=>{let t=e.targetDraftKey?.owner;return t?.kind!==`surface`||typeof t.ownerID!=`string`||!t.ownerID.startsWith(`assistant:`)?null:t.ownerID.slice(10)||null},Vt=e=>({draftID:e.draftID,serverInstanceID:e.serverInstanceID,connectionKey:e.connectionKey,assistantID:e.assistantID,transportIdentity:e.transportIdentity}),Ht=async(e,t)=>{let n=Nt(t),r=[];for(let t of Object.values(W(n))){if(t.phase===`cancelled`){r.push(Vt(t));continue}if(t.phase===`materialized`)try{await e(t.draftID);let i={...t,phase:`cancelled`};if(!G(n,i))continue;r.push(Vt(i))}catch{continue}}return r},Ut=(e,t)=>{let n=Nt(t),r=W(n)[e.draftID];return!r||r.phase!==`cancelled`||r.serverInstanceID!==e.serverInstanceID||r.connectionKey!==e.connectionKey||r.assistantID!==e.assistantID||r.transportIdentity!==e.transportIdentity?!1:(Ft(n,e.draftID),!W(n)[e.draftID])},Wt=async(e,t)=>{let n=d({transportIdentity:e.transportIdentity},`assistant:${e.assistantID}`),r=t.captureDraftRuntime();if(r.transportIdentity!==e.transportIdentity)return!1;let i=t.getDraft(n),a=jt(e.draftID);try{if(!i||!i.syntheticParts.some(e=>e.partID===a)){await t.flushDraftPersistence();let n=t.captureDraftRuntime();return n.transportIdentity===e.transportIdentity&&n.generation===r.generation}let o=await t.commitDraftSnapshot({key:n,expectedRevision:i.revision,runtime:r,values:new Map,snapshot:{text:i.text,attachments:i.attachments,syntheticParts:i.syntheticParts.filter(e=>e.partID!==a),mentions:i.mentions,...i.composerReferences===void 0?{}:{composerReferences:i.composerReferences}}});if(!o.current||!o.durable)return!1;await t.flushDraftPersistence();let s=t.captureDraftRuntime();return s.transportIdentity===e.transportIdentity&&s.generation===r.generation}catch{return!1}},Gt=async(e,t)=>{if(e.attachments.length>10||!e.attachments.every(Rt)||e.attachments.reduce((e,t)=>e+t.byteSize,0)>At)throw Error(`invalid_share_attachment`);let n=Nt(t.storage),r=d({transportIdentity:t.transportIdentity},`assistant:${e.assistantID}`),i=W(n)[e.draftID],a=!1;if(!i||g(i.targetDraftKey)!==g(r)){let a=t.input.getDraft(r);if(i={draftID:e.draftID,serverInstanceID:e.serverInstanceID,connectionKey:e.connectionKey,assistantID:e.assistantID,transportIdentity:t.transportIdentity,targetDraftKey:r,baseRevision:a?.revision??`absent`,resultText:Lt(a?.text??``,e.text),attachmentIDs:e.attachments.map((t,n)=>It(e.draftID,n)),phase:`materializing`},!G(n,i))throw Error(`handoff_journal_unavailable`)}if(i.phase===`cancelled`)return{durable:!0,cancelled:!0};(i.phase===`materialized`||zt(i,t.input.getDraft(r)))&&(a=!0);for(let o=0;!a&&o<3;o++){let o=t.input.getDraft(r),s={...i,baseRevision:o?.revision??`absent`,resultText:Lt(o?.text??``,e.text),phase:`materializing`};if(!G(n,s))throw Error(`handoff_journal_unavailable`);i=s;let c=new Map,l=[];for(let n=0;n<e.attachments.length;n++){let r=e.attachments[n],a=i.attachmentIDs[n],o=f(a),s=await t.readAttachment(r);if(s.size!==r.byteSize)throw Error(`staged_file_unavailable`);c.set(o,s.type===r.mime?s:new Blob([s],{type:r.mime})),l.push({attachmentID:a,attachmentRefID:o,filename:r.originalName,mimeType:r.mime,size:r.byteSize,locator:{kind:`blob`,blobID:a},source:`local`})}let u={partID:jt(e.draftID),text:``,attachments:[],synthetic:!0},d=o?.syntheticParts??[],p=await t.input.commitDraftSnapshot({key:r,expectedRevision:o?.revision??`absent`,runtime:t.input.captureDraftRuntime(),snapshot:{text:i.resultText,attachments:[...o?.attachments??[],...l],syntheticParts:d.some(e=>e.partID===u.partID)?d:[...d,u],mentions:o?.mentions??[],...o?.composerReferences===void 0?{}:{composerReferences:o.composerReferences}},values:c});if(p.durable&&p.current)a=!0;else if(p.status!==`conflict`)throw Error(`draft_handoff_${p.status}`)}if(!a)throw Error(`draft_handoff_conflict`);if(i.phase!==`materialized`&&(i={...i,phase:`materialized`},!G(n,i)))throw Error(`handoff_journal_unavailable`);try{await t.cancelDraft(e.draftID)}catch{return{durable:!0,cancelled:!1}}if(i={...i,phase:`cancelled`},!G(n,i))throw Error(`handoff_journal_unavailable`);return{durable:!0,cancelled:!0}},Kt=ee(`OpenChamberShare`),qt=null,Jt=(e,t)=>o()===e&&u()===t,Yt=e=>{if(b()){fe(e);return}let t=ae.getState();t.setActiveTab(`assistant`),t.openAssistant(e)},Xt=async()=>{let e=(await Kt.pendingAssistantOpen().catch(()=>null))?.request;if(!e)return!1;let t=await ut(e.connectionKey);if(t===`missing`)return await Kt.ackAssistantOpen({requestID:e.requestID}).catch(()=>void 0),!0;if(t!==`connected`)return!0;let n=u();if(!Jt(e.connectionKey,n))return!0;try{let[t,r]=await Promise.all([w(),de()]);if(!Jt(e.connectionKey,n))return!0;let i=r.assistants.some(t=>t.id===e.assistantID&&t.enabled);if(!t.supported||!t.enabled||t.serverInstanceID!==e.serverInstanceID||!i)return await Kt.ackAssistantOpen({requestID:e.requestID}),!0;Yt(e.assistantID),await Kt.ackAssistantOpen({requestID:e.requestID})}catch{}return!0},K=async()=>x.getPlatform()===`android`?qt||(qt=Xt().finally(()=>{qt=null}),qt):!1,Zt=new Intl.Segmenter(void 0,{granularity:`grapheme`}),Qt=/(?:\p{Extended_Pictographic}|\p{Regional_Indicator}|\u20e3)/u,$t=e=>{let t=Zt.segment(e)[Symbol.iterator]().next().value?.segment;return!t||!Qt.test(t)?{displayName:e}:{avatarEmoji:t,displayName:e.slice(t.length).trimStart()}},q=_();function en(e){let t=(0,_e.c)(30),{draft:n,entries:r,busy:i,onSelect:a,onCancel:o}=e,{t:s}=ie(),c;t[0]!==i||t[1]!==n||t[2]!==o?(c=()=>{n&&!i&&o(n)},t[0]=i,t[1]=n,t[2]=o,t[3]=c):c=t[3];let l=S(c),u;t[4]===l?u=t[5]:(u=e=>{e||l()},t[4]=l,t[5]=u);let d=S(u),f;t[6]!==n||t[7]!==a?(f=e=>{n&&a(n,e)},t[6]=n,t[7]=a,t[8]=f):f=t[8];let p=S(f),m=!!n,h;t[9]===s?h=t[10]:(h=s(`assistants.shareWelcome.example.note.title`),t[9]=s,t[10]=h);let g;t[11]===s?g=t[12]:(g=s(`settings.common.actions.cancel`),t[11]=s,t[12]=g);let _;t[13]!==i||t[14]!==l||t[15]!==h||t[16]!==g?(_=(0,q.jsx)(ue,{title:h,backAriaLabel:g,onBack:l,backDisabled:i,overlay:!0}),t[13]=i,t[14]=l,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==i||t[19]!==r||t[20]!==p||t[21]!==s?(v=r.length?(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-[calc(max(0.25rem,var(--oc-safe-area-top,0px))+var(--oc-mobile-detail-navigation-height,3.5rem)+0.75rem)]`,role:`listbox`,"aria-label":s(`assistants.listAria`),children:r.map(e=>{let t=$t(e.name),n=t.displayName||e.name;return(0,q.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":`false`,disabled:i,className:`flex w-full items-center gap-3 border-b border-border/60 px-3 py-4 text-left text-foreground transition-colors last:border-b-0 hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60`,onClick:()=>p(e),children:[(0,q.jsx)(he,{name:e.avatarSeed,emoji:t.avatarEmoji,size:36,label:n}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`span`,{className:`block truncate font-semibold`,children:n}),(0,q.jsx)(`span`,{className:`block truncate typography-small text-muted-foreground`,children:e.serverLabel})]}),(0,q.jsx)(ge,{name:`arrow-right-s`,className:`size-4 shrink-0 text-muted-foreground`})]},`${e.connectionKey}:${e.assistantID}`)})}):(0,q.jsx)(`p`,{className:`px-5 pb-[max(1.25rem,env(safe-area-inset-bottom))] pt-[calc(max(0.25rem,var(--oc-safe-area-top,0px))+var(--oc-mobile-detail-navigation-height,3.5rem)+0.75rem)] typography-ui text-muted-foreground`,children:s(`assistants.state.unavailable`)}),t[18]=i,t[19]=r,t[20]=p,t[21]=s,t[22]=v):v=t[22];let y;t[23]!==_||t[24]!==v?(y=(0,q.jsxs)(pe,{className:`h-[100dvh] max-h-none w-screen max-w-none gap-0 overflow-hidden rounded-none border-0 bg-background p-0`,containerClassName:`items-stretch p-0`,overlayClassName:`bg-background`,showCloseButton:!1,children:[_,v]}),t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==d||t[27]!==m||t[28]!==y?(b=(0,q.jsx)(me,{open:m,onOpenChange:d,children:y}),t[26]=d,t[27]=m,t[28]=y,t[29]=b):b=t[29],b}var tn=t({MobileShareBridge:()=>Pn,donateNativeAssistantInteraction:()=>Cn,publishNativeAssistantCatalog:()=>Sn,refreshNativeAssistantCatalog:()=>Q}),J=ee(`OpenChamberShare`),nn=`openchamber.mobile-share.outbox.v1`,rn=()=>x.isNativePlatform(),an=()=>{try{return JSON.parse(window.localStorage.getItem(nn)||`{}`)}catch{return{}}},on=e=>{try{window.localStorage.setItem(nn,JSON.stringify(e))}catch{}},Y=e=>{let t=an(),n=t[e.envelope.operationID];n&&n.updatedAt>e.updatedAt||(t[e.envelope.operationID]=e,on(t))},X=(e,t)=>o()===e&&u()===t,sn=new Map,cn=null,ln=null,un=!1,dn=[],fn=0,pn=new Set,Z=new Map,mn=1,hn=e=>{e.map(e=>e.draftID).join(`
3
+ `)!==dn.map(e=>e.draftID).join(`
4
+ `)&&(dn=e,fn+=1,pn.forEach(e=>e()))},gn=e=>hn(dn.filter(t=>t.draftID!==e)),_n=e=>(pn.add(e),()=>pn.delete(e)),vn=()=>fn,yn=async e=>{if(!e.mime.startsWith(`image/`))throw Error(`unsupported_share_attachment`);let t=e.stagedPath.trim();if(!t)throw Error(`staged_file_unavailable`);let n=/^(?:data:|https?:|content:|file:)/i.test(t)?t:`file://${t}`,r=/^(?:data:|https?:)/i.test(n)?n:x.convertFileSrc(n);return await fetch(r).then(e=>{if(!e.ok)throw Error(`staged_file_unavailable`);return e.blob()})},bn=async e=>{let t=await yn(e);return await new Promise((e,n)=>{let r=new FileReader;r.onerror=()=>n(Error(`staged_file_unavailable`)),r.onload=()=>typeof r.result==`string`?e(r.result):n(Error(`staged_file_unavailable`)),r.readAsDataURL(t)})},xn=async e=>{let t=[];if(e.text?.trim()&&t.push({type:`text`,text:e.text}),e.attachments.length>10)throw Error(`too_many_share_attachments`);for(let n of e.attachments){if(n.byteSize<=0||n.byteSize>20971520)throw Error(`invalid_share_attachment`);t.push({type:`file`,mime:n.mime,url:await bn(n)})}if(t.length===0)throw Error(`empty_share`);return t},Q=async()=>{if(!rn())return;let e=o(),t=(await at()).find(t=>Pe(t)===e);if(!t)return;let n=u();try{let[r,i]=await Promise.all([w(),le()]);if(!X(e,n)||!r.supported||!r.serverInstanceID)return;let a=r.serverInstanceID,o=i.assistants.map(n=>({serverInstanceID:a,assistantID:n.id,name:n.name,avatarSeed:n.id,serverLabel:t.label,connectionKey:e,enabled:r.enabled&&n.enabled,isDefaultShareTarget:!1}));T.getState().replaceCatalogPartition({serverInstanceID:a,connectionKey:e,revision:i.revision,lastLoadedAt:Date.now(),entries:o}),await Sn()}catch{}},Sn=async()=>{if(!rn())return;let e=Object.values(T.getState().assistantCatalogByConnection).flatMap(e=>e.entries).map(e=>{let t=$t(e.name);return{...e,name:t.displayName||e.name,...t.avatarEmoji?{avatarEmoji:t.avatarEmoji}:{}}});await J.updateCatalog({entries:e})},Cn=async e=>{x.getPlatform()===`ios`&&await J.donateAssistantInteraction(e)},wn=e=>{let t=sn.get(e.operationID);if(t)return t;let n=En(e);return sn.set(e.operationID,n),n.finally(()=>{sn.get(e.operationID)===n&&sn.delete(e.operationID)}).catch(()=>void 0),n},Tn=async e=>{e.cleanupPhase!==`files-released`&&(e.cleanupPhase===`server-completed`&&(await wt(()=>J.ack({operationID:e.envelope.operationID})),e={...e,state:`delivered`,cleanupPhase:`native-acked`,updatedAt:Date.now()},Y(e)),e.cleanupPhase===`native-acked`&&(await wt(()=>J.releaseFiles({operationID:e.envelope.operationID})),Y({...e,state:`delivered`,cleanupPhase:`files-released`,updatedAt:Date.now()})))},En=async e=>{let t=an()[e.operationID];if(t?.cleanupPhase){await Tn(t);return}let n=t?.messageID?t:{envelope:e,messageID:h(`msg`),state:t?.state??`pending`,cleanupPhase:t?.cleanupPhase,updatedAt:Date.now(),error:t?.error};Y(n),n={...n,state:`resolving-instance`,updatedAt:Date.now()},Y(n);let r=Object.values(T.getState().assistantCatalogByConnection).find(t=>t.serverInstanceID===e.serverInstanceID&&t.entries.some(t=>t.assistantID===e.assistantID));if(!r){Y({...n,state:`target-stale`,updatedAt:Date.now()});return}n={...n,state:`connecting`,updatedAt:Date.now()},Y(n);let a=await ut(r.connectionKey);if(a===`auth-required`){Y({...n,state:`auth-required`,updatedAt:Date.now()});return}if(a!==`connected`){Y({...n,state:`offline`,updatedAt:Date.now()});return}let o=u(),s=null;if(X(r.connectionKey,o)){try{if(await m(`/api/config/settings`).catch(()=>void 0),!X(r.connectionKey,o))return;let[t,a]=await Promise.all([w(),le()]);if(!X(r.connectionKey,o)||!t.supported||t.serverInstanceID!==e.serverInstanceID){Y({...n,state:`target-stale`,updatedAt:Date.now()});return}let c=a.assistants.find(t=>t.id===e.assistantID&&t.enabled);if(!t.enabled||!c){Y({...n,state:`target-stale`,updatedAt:Date.now()});return}n={...n,state:`dispatching`,updatedAt:Date.now()},Y(n);let l=await xn(e);if(!X(r.connectionKey,o))return;n={...n,state:`reconciling`,updatedAt:Date.now()},Y(n);let u=await ce(c.id,e.operationID,n.messageID,l,e.source),d=await se(u,i(),o),f=await de().catch(e=>(Y({...n,state:`reconciling`,updatedAt:Date.now(),error:e instanceof Error?e.message:`snapshot_refresh_failed`}),null));if(!f)return;if(!X(r.connectionKey,o)){Y({...n,state:`reconciling`,updatedAt:Date.now(),error:`runtime_stale`});return}let p=f.assistants.find(e=>e.id===c.id);if(!p||p.sessionID!==d.sessionID){Y({...n,state:`reconciling`,updatedAt:Date.now(),error:`assistant_binding_mismatch`});return}s=p.id}catch(e){if(e instanceof oe&&e.code===`share_unresolved`||e instanceof Error&&e.message===`runtime_stale`){Y({...n,state:`reconciling`,updatedAt:Date.now(),error:e instanceof Error?e.message:`share_unresolved`});return}Y({...n,state:`failed`,updatedAt:Date.now(),error:e instanceof Error?e.message:`dispatch_failed`});return}n={...n,state:`delivered`,cleanupPhase:`server-completed`,updatedAt:Date.now()},Y(n),Yt(s),await Tn(n)}},Dn=async()=>cn||(cn=On().finally(()=>{cn=null}),cn),On=async()=>{if(!rn())return;let e=await J.listPending().catch(()=>null),t=new Map((e?.envelopes??[]).map(e=>[e.operationID,e])),n=an();await Tt([...[...t.values()].map(e=>({operationID:e.operationID,cleanupPhase:n[e.operationID]?.cleanupPhase})),...Object.values(n).filter(e=>!t.has(e.envelope.operationID)&&(!!(e.cleanupPhase&&e.cleanupPhase!==`files-released`)||e.state!==`delivered`&&e.state!==`auth-required`&&e.state!==`target-stale`)).map(e=>({operationID:e.envelope.operationID,cleanupPhase:e.cleanupPhase}))],{deliver:async e=>{let r=t.get(e)??n[e]?.envelope;r&&await wn(r)},cleanup:async e=>{let t=an()[e];t&&await Tn(t)}},mn)},$=async()=>(un=!0,ln||(ln=(async()=>{do un=!1,await Nn();while(un)})().finally(()=>{ln=null,un&&$()}),ln)),kn=async e=>{if(o()!==e.connectionKey&&await ut(e.connectionKey)!==`connected`)return!1;let t=u();if(!X(e.connectionKey,t)||i()!==e.transportIdentity||(await m(`/api/config/settings`).catch(()=>void 0),!X(e.connectionKey,t)||i()!==e.transportIdentity)||!await C.getState().hydrateDraftMetadata(e.transportIdentity)||!X(e.connectionKey,t)||i()!==e.transportIdentity)return!1;let[n,r]=await Promise.all([w(),de()]);return!X(e.connectionKey,t)||i()!==e.transportIdentity||!n.supported||!n.enabled||n.serverInstanceID!==e.serverInstanceID||!r.assistants.some(t=>t.id===e.assistantID&&t.enabled)?!1:(Yt(e.assistantID),!0)},An=async e=>{let t=o(),n=u();if(await m(`/api/config/settings`).catch(()=>void 0),!X(t,n))return null;try{let[r,a]=await Promise.all([w(),de()]);return!X(t,n)||!r.supported||!r.enabled||r.serverInstanceID!==e.serverInstanceID||!a.assistants.some(t=>t.id===e.assistantID&&t.enabled)?null:{runtimeKey:t,generation:n,transportIdentity:i()}}catch{return null}},jn=async e=>{let t=Object.values(T.getState().assistantCatalogByConnection).find(t=>t.serverInstanceID===e.serverInstanceID&&t.connectionKey===e.connectionKey&&t.entries.some(t=>t.assistantID===e.assistantID));if(!t)return!1;let n=await An(e);if(!n&&(await ut(t.connectionKey,{transportPreference:`relay`})!==`connected`||(n=await An(e),!n)))return!1;let{runtimeKey:r,generation:a,transportIdentity:o}=n;if(!await C.getState().hydrateDraftMetadata(o)||!X(r,a)||i()!==o)return!1;let s=await Gt(e,{input:C.getState(),transportIdentity:o,cancelDraft:e=>J.cancelDraft({draftID:e}),readAttachment:yn});if(!s.durable||!s.cancelled||!X(r,a)||i()!==o)return!1;let c={draftID:e.draftID,serverInstanceID:e.serverInstanceID,connectionKey:e.connectionKey,assistantID:e.assistantID,transportIdentity:o};return Yt(e.assistantID),await Wt(c,C.getState())&&Ut(c),!0},Mn=e=>{let t=Z.get(e.draftID);if(t)return t;let n=jn(e).catch(()=>!1).finally(()=>{Z.get(e.draftID)===n&&Z.delete(e.draftID)});return Z.set(e.draftID,n),n},Nn=async()=>{if(x.getPlatform()!==`android`)return;let e=await Ht(e=>J.cancelDraft({draftID:e}));for(let t of e)try{await kn(t)&&await Wt(t,C.getState())&&Ut(t)}catch{}let t=await J.listDrafts().catch(()=>null);if(!t)return;let n=[...t?.drafts??[]].sort((e,t)=>e.createdAt-t.createdAt);hn(n.filter(e=>!Et(e)));for(let e of n)Et(e)&&await Mn(e)},Pn=()=>{let e=(0,_e.c)(11);E.useSyncExternalStore(_n,vn,vn);let t=T(Fn),[n,r]=E.useState(null),i=E.useRef(null),a;e[0]===t?a=e[1]:(a=Object.values(t).flatMap(In).filter(Ln).sort(Rn),e[0]=t,e[1]=a);let o=a,s=dn[0]??null,c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(e,t)=>{i.current||(i.current=e.draftID,r(e.draftID),Mn({...e,serverInstanceID:t.serverInstanceID,assistantID:t.assistantID,name:t.name,avatarSeed:t.avatarSeed,serverLabel:t.serverLabel,connectionKey:t.connectionKey}).then(t=>{t&&gn(e.draftID)}).finally(()=>{i.current===e.draftID&&(i.current=null),r(t=>t===e.draftID?null:t)}))},e[2]=c):c=e[2];let l=S(c),u;e[3]===n?u=e[4]:(u=e=>{n!==e.draftID&&(gn(e.draftID),J.cancelDraft({draftID:e.draftID}).catch(zn))},e[3]=n,e[4]=u);let d=S(u),f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],e[5]=f):f=e[5],E.useEffect(Jn,f);let p=n===s?.draftID,m;return e[6]!==d||e[7]!==o||e[8]!==l||e[9]!==p?(m=(0,q.jsx)(en,{draft:s,entries:o,busy:p,onSelect:l,onCancel:d}),e[6]=d,e[7]=o,e[8]=l,e[9]=p,e[10]=m):m=e[10],m};function Fn(e){return e.assistantCatalogByConnection}function In(e){return e.entries}function Ln(e){return e.enabled}function Rn(e,t){return Number(t.isDefaultShareTarget)-Number(e.isDefaultShareTarget)||e.serverLabel.localeCompare(t.serverLabel)||e.name.localeCompare(t.name)}function zn(){$()}function Bn(){Q(),$(),K()}function Vn(){Q(),Dn(),$(),K()}function Hn(){Dn()}function Un(){}function Wn(){$()}function Gn(){}function Kn(){K()}function qn(){}function Jn(){if(!rn())return;Q(),Dn(),$(),K();let e=n(Bn),t=Vn;window.addEventListener(`openchamber:system-resume`,t);let r=!1,i=null,a=null,o=null;return J.addListener(`shareReceived`,Hn).then(e=>{r?e.remove():i=e}).catch(Un),J.addListener(`shareDraftReceived`,Wn).then(e=>{r?e.remove():a=e}).catch(Gn),J.addListener(`assistantOpenRequested`,Kn).then(e=>{r?e.remove():o=e}).catch(qn),()=>{r=!0,e(),window.removeEventListener(`openchamber:system-resume`,t),i&&i.remove(),a&&a.remove(),o&&o.remove()}}export{$t as a,lt as c,_t as d,vt as f,Q as i,A as l,Cn as n,K as o,Ct as p,Sn as r,Mt as s,Pn as t,ct as u};