@inkeep/open-knowledge 0.63.6-beta.0 → 0.63.7-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/{acp-harness-probe-WJAVtQtT.mjs → acp-harness-probe-kSEky28Y.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-d2OJ4dm9.mjs +2 -0
  4. package/dist/index.d.mts +17 -17
  5. package/dist/index.mjs +4 -4
  6. package/dist/init-CA1gxiZW.mjs +1 -0
  7. package/dist/{init-BvbrMy_c.mjs → init-l1DAFbEu.mjs} +3 -3
  8. package/dist/{launch-json-removal-CIW-KVUE.mjs → launch-json-removal-CoVn9BKk.mjs} +2 -2
  9. package/dist/{loader-Do24QJxR.mjs → loader-BzpZrnef.mjs} +2 -2
  10. package/dist/loader-CWy-Ajoy.mjs +1 -0
  11. package/dist/{open-browser-BBXmgdSf.mjs → open-browser-W5CxYsJ4.mjs} +2 -2
  12. package/dist/{preview-BTKp_jbq.mjs → preview-14jfeNz4.mjs} +2 -2
  13. package/dist/preview-CKqCTAaw.mjs +1 -0
  14. package/dist/public/assets/{ActivityModeContent-CDwLnkur.js → ActivityModeContent-6YpAjqqD.js} +1 -1
  15. package/dist/public/assets/{AddPropertiesButton-CW8Aw1Ow.js → AddPropertiesButton-CvbHqm7d.js} +1 -1
  16. package/dist/public/assets/{AgentDiffPane-BVLzLkmN.js → AgentDiffPane-DoF9f0eV.js} +1 -1
  17. package/dist/public/assets/{CodeMirrorPropInput-wxzi2HMF.js → CodeMirrorPropInput-B2m6_Glf.js} +1 -1
  18. package/dist/public/assets/{DocumentContext-Cvt0LP7f.js → DocumentContext-C7cdXT-e.js} +1 -1
  19. package/dist/public/assets/{EditorModeToggle-kh954H7n.js → EditorModeToggle-DjxeMzAI.js} +1 -1
  20. package/dist/public/assets/{EnableSyncConfirmDialog-CGe9_A_T.js → EnableSyncConfirmDialog-DlvVoGyg.js} +1 -1
  21. package/dist/public/assets/{ExcalidrawDocEditor-C-k0Gw0x.js → ExcalidrawDocEditor-GiWViBdj.js} +1 -1
  22. package/dist/public/assets/FeedbackForm-Bq32DvV_.js +1 -0
  23. package/dist/public/assets/{ImportSkillDialog-swD86t8y.js → ImportSkillDialog-DjaEcb_U.js} +1 -1
  24. package/dist/public/assets/{LintConfigEditor-Ddn-00az.js → LintConfigEditor-CUFHmadV.js} +1 -1
  25. package/dist/public/assets/ManagedArtifactProperties-C14_GjVm.js +1 -0
  26. package/dist/public/assets/ManagedArtifactProperties-Cml7rJ9f.js +1 -0
  27. package/dist/public/assets/{MermaidDocEditor-jpK-jOqW.js → MermaidDocEditor-CMist5j4.js} +1 -1
  28. package/dist/public/assets/{PropertyDisplayRow-DSUHH0dm.js → PropertyDisplayRow-CaaMd6Te.js} +1 -1
  29. package/dist/public/assets/{SchemaConfigEditor-DKNjtQfc.js → SchemaConfigEditor-BdmIC8ic.js} +1 -1
  30. package/dist/public/assets/{SessionsHost-vghNnZ3V.js → SessionsHost-B4ARZMWM.js} +2 -2
  31. package/dist/public/assets/{SettingsDialogBody-CUefNgT3.js → SettingsDialogBody-Dg72aO2_.js} +1 -1
  32. package/dist/public/assets/{ShareReceiveMissDialog-8Y26RmsH.js → ShareReceiveMissDialog-D0MRYtPQ.js} +1 -1
  33. package/dist/public/assets/{SkillInstallMenu-qZYVaUQ-.js → SkillInstallMenu-C0acjJLL.js} +1 -1
  34. package/dist/public/assets/{SkillToolbarControls-Da999GtJ.js → SkillToolbarControls-DH9unxQu.js} +1 -1
  35. package/dist/public/assets/{SourceEditor-CuLYTbyc.js → SourceEditor-CLHcAgyL.js} +1 -1
  36. package/dist/public/assets/{TerminalWindowApp-aKaZBicV.js → TerminalWindowApp-D-52X6sF.js} +1 -1
  37. package/dist/public/assets/{TextDocEditor-CUal8EWS.js → TextDocEditor-B7zKRBQu.js} +1 -1
  38. package/dist/public/assets/{ThreadView-dEdvtl4x.js → ThreadView-DbJiucwL.js} +1 -1
  39. package/dist/public/assets/{TimelineDiffPane-CS51BRRU.js → TimelineDiffPane-DSHNUefz.js} +1 -1
  40. package/dist/public/assets/{agent-diff-store-DBEnYw8y.js → agent-diff-store-DQBmr6JD.js} +1 -1
  41. package/dist/public/assets/{auth-state-cache-BSNH7pxf.js → auth-state-cache-CskNBk0b.js} +1 -1
  42. package/dist/public/assets/{client-version-DQocZOxE.js → client-version-BVE7Lug9.js} +1 -1
  43. package/dist/public/assets/{comment-chips-DKGNPHft.js → comment-chips-CBw_14rd.js} +1 -1
  44. package/dist/public/assets/{config-provider-BkCITdUN.js → config-provider-CRIf4i0O.js} +3 -3
  45. package/dist/public/assets/i18n-BAClLrqy.js +1 -0
  46. package/dist/public/assets/index-BezpdRgd.js +2196 -0
  47. package/dist/public/assets/messages-BCzdglIs.js +1 -0
  48. package/dist/public/assets/messages-BNXhZIvP.js +1 -0
  49. package/dist/public/assets/messages-BTOATtFo.js +1 -0
  50. package/dist/public/assets/messages-CEAIJ2vr.js +1 -0
  51. package/dist/public/assets/messages-CP6EucXo.js +1 -0
  52. package/dist/public/assets/{messages-zKbHKiGQ.js → messages-CZYMn827.js} +1 -1
  53. package/dist/public/assets/messages-DSiLvtAQ.js +1 -0
  54. package/dist/public/assets/messages-DeCaehhs.js +1 -0
  55. package/dist/public/assets/messages-Ds6A6ql_.js +1 -0
  56. package/dist/public/assets/messages-LQQZNjF5.js +1 -0
  57. package/dist/public/assets/messages-hYFi4d1C.js +1 -0
  58. package/dist/public/assets/messages-natrutgz.js +1 -0
  59. package/dist/public/assets/{pending-receive-nav-store-BDfVJPhG.js → pending-receive-nav-store-C-FQhKEU.js} +1 -1
  60. package/dist/public/assets/{progress-BeVvrxJn.js → progress-CigYi-Tn.js} +1 -1
  61. package/dist/public/assets/{selection-context-OMBgzLme.js → selection-context-CFDH0uJe.js} +1 -1
  62. package/dist/public/assets/{src-BhVr0kka.js → src-Bhg0wW5z.js} +1 -1
  63. package/dist/public/assets/{telemetry-impl-CS8q68dm.js → telemetry-impl-iZ2fCjUS.js} +1 -1
  64. package/dist/public/assets/{telemetry-startup-DxikYwVQ.js → telemetry-startup-nQ2Tqj0Y.js} +1 -1
  65. package/dist/public/assets/typing-burst-detector-hl4Mjwn6.js +8 -0
  66. package/dist/public/assets/{uninstall-BAaKe1f7.js → uninstall-Br9QzCO_.js} +1 -1
  67. package/dist/public/assets/{use-activity-panel-CgE_sMHl.js → use-activity-panel-BGRkHINw.js} +1 -1
  68. package/dist/public/assets/{use-open-skill-UxwOkgOg.js → use-open-skill-BTISsK-W.js} +1 -1
  69. package/dist/public/assets/{use-terminal-enabled-RWpxHojI.js → use-terminal-enabled-DVAnxqo8.js} +1 -1
  70. package/dist/public/assets/{use-timeline-entry-diff-CiMOs2tM.js → use-timeline-entry-diff-fiqDvS14.js} +1 -1
  71. package/dist/public/index.html +21 -21
  72. package/dist/public/uninstall.html +3 -3
  73. package/dist/{repair-launch-json-CHHqMadD.mjs → repair-launch-json-CJ3RlgyB.mjs} +2 -2
  74. package/dist/{repair-mcp-configs-EXM9zl9Q.mjs → repair-mcp-configs-DwdaBxJS.mjs} +2 -2
  75. package/dist/repair-skills-CiWDpMXb.mjs +1 -0
  76. package/dist/{repair-skills-CM72fFBm.mjs → repair-skills-DquHsHSZ.mjs} +2 -2
  77. package/dist/{resolve-project-root-FELgKP-i.mjs → resolve-project-root-TgFFxl73.mjs} +2 -2
  78. package/dist/{skill-teardown-TN6Eh0tj.mjs → skill-teardown-DLbNuqvC.mjs} +2 -2
  79. package/dist/src-2igu-66q.mjs +2039 -0
  80. package/dist/src-COnLaxba.mjs +1 -0
  81. package/dist/{src-BJwPz37r.mjs → src-CauaRuF2.mjs} +2 -2
  82. package/dist/{src-BBvMpF-z.mjs → src-nJP2O0vw.mjs} +1 -1
  83. package/dist/{start-DUjsSsyo.mjs → start-8eEIzNo3.mjs} +3 -3
  84. package/dist/start-BFu9Zxqs.mjs +1 -0
  85. package/package.json +4 -4
  86. package/dist/constants-U70amxg2.mjs +0 -2
  87. package/dist/init-OJUm6IDN.mjs +0 -1
  88. package/dist/loader-DEY1Nexh.mjs +0 -1
  89. package/dist/preview-DtqUEi9W.mjs +0 -1
  90. package/dist/public/assets/FeedbackForm-BCVkEKZo.js +0 -1
  91. package/dist/public/assets/ManagedArtifactProperties-DUdzf0GY.js +0 -1
  92. package/dist/public/assets/ManagedArtifactProperties-ZyBEN-kK.js +0 -1
  93. package/dist/public/assets/i18n-BWhLHunP.js +0 -1
  94. package/dist/public/assets/index-Cu-vLBis.js +0 -2196
  95. package/dist/public/assets/messages-B2hUo_Xd.js +0 -1
  96. package/dist/public/assets/messages-BQ-C7DO5.js +0 -1
  97. package/dist/public/assets/messages-BVii8gJ-.js +0 -1
  98. package/dist/public/assets/messages-Bty_PjtX.js +0 -1
  99. package/dist/public/assets/messages-CLyVrekl.js +0 -1
  100. package/dist/public/assets/messages-COIWQ-j4.js +0 -1
  101. package/dist/public/assets/messages-CU1qUVuk.js +0 -1
  102. package/dist/public/assets/messages-CUPuto82.js +0 -1
  103. package/dist/public/assets/messages-D0de9xXn.js +0 -1
  104. package/dist/public/assets/messages-DgoaqCkp.js +0 -1
  105. package/dist/public/assets/messages-aUA-LBBS.js +0 -1
  106. package/dist/public/assets/typing-burst-detector-B3y1Rq0N.js +0 -8
  107. package/dist/repair-skills-COLAZSGU.mjs +0 -1
  108. package/dist/src-B9KXB9Ap.mjs +0 -1
  109. package/dist/src-DKRPWoiG.mjs +0 -2039
  110. package/dist/start-BpLu52x0.mjs +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-BH80AfFt.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-BDfVJPhG.js";import{t as m}from"./miss-dialog-store-CdkrAlK3.js";import{f as h,p as g}from"./doc-paths-oMq41Y7d.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(m.subscribe,m.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=f(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){m.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(l(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){p.arm(d(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(s,{children:(0,y.jsx)(i,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(u,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(o,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(c,{open:!0,onOpenChange:D,children:(0,y.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-BH80AfFt.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-C-FQhKEU.js";import{t as m}from"./miss-dialog-store-CdkrAlK3.js";import{f as h,p as g}from"./doc-paths-oMq41Y7d.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(m.subscribe,m.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=f(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){m.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(l(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){p.arm(d(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(s,{children:(0,y.jsx)(i,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(u,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(o,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(c,{open:!0,onOpenChange:D,children:(0,y.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
@@ -1,2 +1,2 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Zn as n}from"./DocumentContext-Cvt0LP7f.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{i as u,n as d,t as f}from"./tooltip-DPvMEqsq.js";import{a as p,c as m,i as h,l as g,o as _,r as v,s as y}from"./alert-dialog-C8E8SkhJ.js";import{C as b,a as x,c as S,d as C,f as w,l as T,p as E,r as D,s as O,u as k}from"./terminal-cli-display-C-s_gqLX.js";import{a as A,d as j,f as M,i as N,n as P,o as F,p as I,u as L}from"./dropdown-menu-BpLbh79a.js";import{Yt as R,fo as z,ni as B,qt as V}from"./dist-DSS3ixln2.js";import{n as H}from"./dist-CuH7ikCn.js";import{c as ee}from"./documents-events-DCcMe0wm.js";import{t as U}from"./createLucideIcon-CAkY8Blx.js";import{c as W}from"./use-open-skill-UxwOkgOg.js";import{t as te}from"./spinner-DmibE6UV.js";import{N as ne,S as re,j as G,x as K}from"./skills-api-BLXzXEC-.js";import{i as ie,l as ae,n as oe,r as q}from"./skill-scope-DWsJ838z.js";import{t as J}from"./use-skills-szHEgJLb.js";var Y=t(),X=e(r(),1),Z=o(),se=3100,ce=3;function le(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??ce;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ue={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},de=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function fe(e,t={}){let n=t.rng??Math.random,r=t.colors??de,i=ue[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var pe=1.8,me=90,he=16,ge=380,_e=.025,ve=.1,ye=.18,be=400,xe=9.2736,Se=18.1799,Ce=14.5244,we={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Te(e,t){let{halfWidth:n,apexLift:r}=we[t];return`M${e-n} ${Ce+.3} Q${e} ${Ce-r}, ${e+n} ${Ce+.3}`}function Ee(e){let t=1.5,n=.3;return`M${e-t} ${Ce-n} Q${e} ${Ce+1.4}, ${e+t} ${Ce-n}`}var De=15,Oe=15;function ke(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function Ae(e){let t=(0,Z.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,X.useRef)(null),g=(0,X.useRef)(null),_=(0,X.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,X.useRef)(v),[b,x]=(0,X.useState)(0),[S,C]=(0,X.useState)(0),[w,T]=(0,X.useState)(0),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[1]=E):E=t[1];let[D,O]=(0,X.useState)(E),k=(0,X.useRef)(0),A=(0,X.useRef)(0),j=(0,X.useRef)(void 0),M=p===`sleeping`,N;t[2]!==b||t[3]!==M||t[4]!==u?(N=function(){if(M)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=A.current===0?1/0:e-A.current;A.current=e;let n=le(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Ie),i||(O(fe(n)),n===3&&(k.current=e,T(Fe))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se)},t[2]=b,t[3]=M,t[4]=u,t[5]=N):N=t[5];let P=N,F,I;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>clearTimeout(j.current),I=[],t[6]=F,t[7]=I):(F=t[6],I=t[7]),(0,X.useEffect)(F,I);let L,R;t[8]!==m||t[9]!==M?(L=()=>{m===0||M||(x(3),C(Pe),O(fe(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Ne),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se))},R=[m,M],t[8]=m,t[9]=M,t[10]=L,t[11]=R):(L=t[10],R=t[11]),(0,X.useEffect)(L,R);let z,B;t[12]!==M||t[13]!==f?(z=()=>{if(!f||M||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/ge)),C=-Math.max(-1,Math.min(1,b/ge))*he,w=S*he,T=0,E=0;if(x>=1){let e=Math.min(x/me,1)*pe;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*ve,i+=(w-i)*ve,u.style.transform=`perspective(${be}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*ye,o+=(E-o)*ye;let O=i*_e,k=-r*_e,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},B=[f,M],t[12]=M,t[13]=f,t[14]=z,t[15]=B):(z=t[14],B=t[15]),(0,X.useEffect)(z,B);let V;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=V):V=t[16],(0,X.useLayoutEffect)(V);let H=b>0,ee=H?b:1,U=H?`ok-blob-clicked-${b}`:null,W;t[17]===r?W=t[18]:(W=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=W);let te=M?`cursor-default`:`cursor-pointer`,ne=`body-${S}`,re=M&&`ok-blob-sleeping`,G;t[19]!==U||t[20]!==re?(G=s(`ok-blob-group`,re,U),t[19]=U,t[20]=re,t[21]=G):G=t[21];let K;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Y.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=K):K=t[22];let ie=(H||M)&&`ok-blob-eye-hidden`,ae;t[23]===ie?ae=t[24]:(ae=s(`ok-blob-eye`,ie),t[23]=ie,t[24]=ae);let oe;t[25]===ae?oe=t[26]:(oe=(0,Y.jsx)(`ellipse`,{cx:xe,cy:Ce,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=oe);let q=(H||M)&&`ok-blob-eye-hidden`,J;t[27]===q?J=t[28]:(J=s(`ok-blob-eye ok-blob-eye-right`,q),t[27]=q,t[28]=J);let ce;t[29]===J?ce=t[30]:(ce=(0,Y.jsx)(`ellipse`,{cx:Se,cy:Ce,rx:1.2722,ry:1.9083,className:J}),t[29]=J,t[30]=ce);let ue;t[31]===ee?ue=t[32]:(ue=Te(xe,ee),t[31]=ee,t[32]=ue);let de=(!H||M)&&`ok-blob-eye-hidden`,we;t[33]===de?we=t[34]:(we=s(`ok-blob-happy-eye`,de),t[33]=de,t[34]=we);let De;t[35]!==ue||t[36]!==we?(De=(0,Y.jsx)(`path`,{d:ue,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:we}),t[35]=ue,t[36]=we,t[37]=De):De=t[37];let Oe;t[38]===ee?Oe=t[39]:(Oe=Te(Se,ee),t[38]=ee,t[39]=Oe);let ke=(!H||M)&&`ok-blob-eye-hidden`,Ae;t[40]===ke?Ae=t[41]:(Ae=s(`ok-blob-happy-eye`,ke),t[40]=ke,t[41]=Ae);let Le;t[42]!==Oe||t[43]!==Ae?(Le=(0,Y.jsx)(`path`,{d:Oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Ae}),t[42]=Oe,t[43]=Ae,t[44]=Le):Le=t[44];let Re;t[45]===M?Re=t[46]:(Re=M?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{d:Ee(xe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Y.jsx)(`path`,{d:Ee(Se),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Re);let ze;t[47]!==oe||t[48]!==ce||t[49]!==De||t[50]!==Le||t[51]!==Re?(ze=(0,Y.jsxs)(`g`,{ref:_,children:[oe,ce,De,Le,Re]}),t[47]=oe,t[48]=ce,t[49]=De,t[50]=Le,t[51]=Re,t[52]=ze):ze=t[52];let Q;t[53]!==ne||t[54]!==G||t[55]!==ze?(Q=(0,Y.jsxs)(`g`,{className:G,children:[K,ze]},ne),t[53]=ne,t[54]=G,t[55]=ze,t[56]=Q):Q=t[56];let Be;t[57]===M?Be=t[58]:(Be=M?(0,Y.jsxs)(`g`,{children:[(0,Y.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Y.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=M,t[58]=Be);let Ve;t[59]!==w||t[60]!==D?(Ve=D.length>0&&(0,Y.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(je)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=Ve):Ve=t[61];let He;t[62]!==P||t[63]!==d||t[64]!==te||t[65]!==Q||t[66]!==Be||t[67]!==Ve?(He=(0,Y.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:te,"aria-hidden":`true`,onClick:P,onMouseDown:Me,children:[Q,Be,Ve]}),t[62]=P,t[63]=d,t[64]=te,t[65]=Q,t[66]=Be,t[67]=Ve,t[68]=He):He=t[68];let Ue;return t[69]!==i||t[70]!==W||t[71]!==He?(Ue=(0,Y.jsx)(`span`,{ref:h,className:W,style:i,children:He}),t[69]=i,t[70]=W,t[71]=He,t[72]=Ue):Ue=t[72],Ue}function je(e){return(0,Y.jsx)(`circle`,{cx:De+e.originDx,cy:Oe+e.originDy,r:e.size,className:`ok-blob-firework`,style:ke(e)},e.id)}function Me(e){return e.preventDefault()}function Ne(e){return e+1}function Pe(e){return e+1}function Fe(e){return e+1}function Ie(e){return e+1}var Le=U(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Re=U(`file-plus`,[[`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`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),ze=U(`settings`,[[`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`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q=[...new Set(b.flatMap(e=>e.schemes))];function Be(e,t){let n=t.now?.()??Date.now(),r={};for(let t of b){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Ve(e){return Be({},e)}async function He(e){let t=e.schemes??Q,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ue=Object.fromEntries(Q.map(e=>[e,{installed:!1}]));async function We(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ue}if(!t.ok)return Ue;let n;try{n=await t.json()}catch{return Ue}if(typeof n!=`object`||!n||Array.isArray(n))return Ue;let r=n,i={};for(let e of Q)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Ge(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Ke(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Ve({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Be(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Ge(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function qe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Je(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>He({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>We({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ye(){let e=(0,Z.c)(5),[t,n]=(0,X.useState)(Xe),r=(0,X.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ke(Je());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,X.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Xe(){return Ve({isElectronHost:qe(),now:Date.now})}var Ze=(0,X.createContext)(null);function Qe(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Y.jsx)(Ze,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function $e(){return(0,X.use)(Ze)}function et(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function tt(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function nt(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if(tt(e))return;throw t}if(!tt(e))throw Error(`clipboard API unavailable`)}function rt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:b}=e,{_:x}=a(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==d?(w=d??x({id:`cnGeoo`}),t[3]=x,t[4]=d,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==d||t[8]!==f?(E=f??d??x({id:`s3caR3`}),t[6]=x,t[7]=d,t[8]=f,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==s||t[12]!==C?(O=s??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=s,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Y.jsx)(g,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==c||t[18]!==C?(A=c??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=c,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Y.jsx)(_,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===u?M=t[23]:(M=u?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Y.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Y.jsx)(v,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Y.jsx)(i,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===r?I=t[32]:(I=(0,Y.jsx)(h,{disabled:r,children:F}),t[31]=r,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==r?(L=r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(te,{"aria-hidden":`true`,className:`size-4`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=r,t[36]=L):L=t[36];let R;t[37]!==r||t[38]!==o||t[39]!==L?(R=(0,Y.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:L}),t[37]=r,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Y.jsxs)(y,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Y.jsxs)(p,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function it(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:z[e]??e}function at(e){return e===`claude`?`claude-code`:e}function ot(e){let t=(0,Z.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,Y.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,Y.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,Y.jsx)(Ae,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,Y.jsx)(W,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=at(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,Y.jsx)(D,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function st(e){let t=(0,Z.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let p;t[8]===i?p=t[9]:(p=e=>(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,Y.jsx)(ot,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":it(e)})})}),(0,Y.jsx)(d,{children:it(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,Y.jsx)(d,{children:l.map(it).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,Y.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function ct(e){let t=(0,Z.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function lt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(O,{...r}):(0,Y.jsx)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ut(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(S,{...r}):(0,Y.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function dt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(x,{...r}):(0,Y.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ft(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(T,{...r}):(0,Y.jsx)(F,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(k,{...r}):(0,Y.jsx)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function mt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(C,{...r}):(0,Y.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ht(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(w,{...r}):(0,Y.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function gt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(E,{...r}):(0,Y.jsx)(I,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var _t=Object.freeze({hosts:null,source:null}),vt=new Map,yt=new Map;function bt(e,t){return`${e}:${t}`}function xt(e){return vt.get(e)??_t}function St(e,t){let n=yt.get(e)??new Set;return yt.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&yt.delete(e)}}function Ct(e,t){let n=xt(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?vt.delete(e):vt.set(e,r);for(let t of yt.get(e)??[])t()}}var wt=V.options,Tt=R.options,Et=`.agents/`;function Dt({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${ae(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(Et))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=e?.scope===`global`?Tt:wt,d=(o?[...u,`agents`]:u).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),f=new Set(d.map(e=>a(e))),p=e?.scope===`global`?`~/`:``,m=e?.path?.includes(`/`)?`${p}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,h=m!==null&&!f.has(m)?m:null,g=h===null?r??e?.hosts?.[0]:void 0,_=new Set(e?.conflictHosts??[]),v=new Set(e?.driftPaths??[]),y=new Set(e?.symlinkedHosts??[]),b=[...[...n].filter(e=>e!==g&&!(e in s)&&!_.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:y.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:q(e),display:`${p}${e.path}`,mode:e.mode}))],x=b.map(e=>e.mode),S=x.filter(e=>e===`link`).length,C=x.length===0?i?`link`:`copy`:S*2>=x.length?`link`:`copy`,w=new Map((e?.customPlacements??[]).map(e=>[q(e),e])),T=new Set(w.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=q(e);t!==``&&T.add(t)}}return{pathFor:a,aliases:s,rows:d,sourceRow:h,sourceHost:g,conflicted:_,drifted:v,linked:y,expectedMode:C,convertible:b,customRootRows:e===void 0?[]:[...T].sort().map(t=>({root:t,display:`${p}${t}/${e.name}`,placed:w.get(t)??null})).filter(e=>!f.has(e.display)&&e.display!==m&&!(e.root in s))}}var Ot=`min-w-[24rem]`;function kt(e,t){let n=(0,Z.c)(45),r=t.installingName===e.name,i=(0,X.useRef)(e),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,X.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,X.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=bt(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>St(m,e),g=()=>xt(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,X.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&Ct(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,X.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,X.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,X.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==m||n[26]!==j?(M=()=>{let e=xt(m).hosts;e&&[...e].sort().join(`,`)===j&&Ct(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,X.useEffect)(M,N);let P=(0,X.useRef)(null),F=(0,X.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,X.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,Ct(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(B));if(!r.ok){Ct(m,{hosts:null});return}D.current=[...r.hosts],Ct(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,V;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(V={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=e.scope===`global`?Tt:wt,n=D.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||D.current.includes(e));z([...n,...i],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>K({scope:e.scope,name:e.name,dir:n,mode:r})).then(jt)},unplaceAt(n){t.runLocationWrite(e,()=>ne({scope:e.scope,name:e.name,path:n})).then(At)},setSource(n){Ct(m,{source:n}),t.runLocationWrite(e,()=>G({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Ct(m,{source:null}),H.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=V):V=n[44],V}function At(e){e.ok||H.error(e.error)}function jt(e){e.ok||H.error(e.error)}function $(e){let t=(0,Z.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Y.jsx)(u,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Y.jsx)(d,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Y.jsxs)(f,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Mt(e){let t=(0,Z.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:s,menuKind:c}=e,u=c===void 0?`dropdown`:c,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:m}=n,h=J(),g,_,v,y,b,x,S,C,w,T;if(t[0]!==d||t[1]!==h.data||t[2]!==h.status||t[3]!==f||t[4]!==m||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:c,sourceRow:E,sourceHost:D,conflicted:O,drifted:k,linked:A,expectedMode:j,convertible:M,customRootRows:N}=Dt({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=c,x=E,y=j,_=M,v=N;let P=e=>oe(a,e),F=zt,I=e=>{let t=P(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(F).join(`, `),rootRel:e}}))},L;t[21]!==d||t[22]!==r?(L=(e,t)=>{let n=e.includes(`/`)?e:ae(e,r?.scope??`project`);return(0,Y.jsx)($,{hint:d({id:`0dslv8`,values:{0:F(e),1:F(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:F(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:F(e),1:r.name,2:F(e),subRoot:n,poolRootRel:t}}))&&re({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?ee():H.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Y.jsx)(ot,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=L):L=t[23];let R=L;g=n.installing;let B=ie(r),V=Rt,U;t[24]!==d||t[25]!==s||t[26]!==n?(U=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,Y.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(s?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Y.jsx)(i,{id:`uUCrBv`}):(0,Y.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=s,t[26]=n,t[27]=U):U=t[27];let te=U,ne;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Y.jsx)(i,{id:`npcziF`}),t[28]=ne):ne=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===m?K=t[32]:(K=()=>m(),t[31]=m,t[32]=K);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Y.jsx)(i,{id:`N40H-G`}),t[33]=q):q=t[33];let J;t[34]!==g||t[35]!==K?(J=(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:g,onClick:K,"data-testid":`skill-install-all`,children:q}),t[34]=g,t[35]=K,t[36]=J):J=t[36];let X;t[37]!==G||t[38]!==J?(X=(0,Y.jsx)($,{hint:G,children:J}),t[37]=G,t[38]=J,t[39]=X):X=t[39],t[40]!==u||t[41]!==X?(S=(0,Y.jsxs)(ft,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[ne,X]}),t[40]=u,t[41]=X,t[42]=S):S=t[42],C=x===null?null:(0,Y.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,Y.jsxs)(dt,{menuKind:u,disabled:g,checked:!0,onSelect:Lt,"data-testid":`skill-source-row`,children:[(0,Y.jsx)(W,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:x}),(()=>{let e=V(x).split(`/`).slice(0,-1).join(`/`),t=P(e);return t.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>R(t,e))}):null})(),(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})})]})]})}),w=b.map(t=>{let a=e(t),s=t===`agents`?`.agents`:z[t],c=V(a).split(`/`).slice(0,-1).join(`/`),m=P(c);return(0,Y.jsx)($,{hint:O.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===D?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):B?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:B.plugin,2:a??s,label:s}}):d(a?D===void 0?{id:`xk133d`,values:{path:a}}:y===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,Y.jsxs)(dt,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{O.has(t)||e===!0&&!I(c)||p(t,e===!0)},onSelect:It,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Y.jsx)(ot,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??s}),m.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:m.map(e=>R(e,c))}):null,B?.editor===t&&!f.has(t)?(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,Y.jsx)(i,{id:`scRzTw`})}):null,O.has(t)?(0,Y.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Y.jsx)(i,{id:`jng7Ko`})})}):t===D?(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,Y.jsxs)(Y.Fragment,{children:[!g&&(A.has(t)?`link`:`copy`)!==y?te(t,a??s,A.has(t)?`link`:`copy`):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]}):null,!g&&k.has(V(a))?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(ct,{testId:`skill-drift-${t}`})}):null]})]})},t)}),T=v.map(e=>{let t=e.display;return(0,Y.jsx)($,{hint:e.placed===null?d(D===void 0?{id:`xk133d`,values:{path:t}}:y===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,Y.jsxs)(dt,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!I(e.root))return;n.placeAt(e.root,y)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Ft,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Y.jsx)(ot,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Y.jsx)(W,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),P(e.root).length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:P(e.root).map(t=>R(t,e.root))}):null,!g&&e.placed!==null&&k.has(e.placed.path)?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(ct,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Y.jsxs)(Y.Fragment,{children:[!g&&e.placed.mode!==y?te(e.root,e.display,e.placed.mode):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=d,t[1]=h.data,t[2]=h.status,t[3]=f,t[4]=m,t[5]=u,t[6]=o,t[7]=s,t[8]=r,t[9]=p,t[10]=n,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20];let E;t[43]!==v||t[44]!==b.length||t[45]!==x?(E=b.length===0&&v.length===0&&x===null?(0,Y.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Y.jsx)(i,{id:`MOAoFO`})}):null,t[43]=v,t[44]=b.length,t[45]=x,t[46]=E):E=t[46];let D;t[47]!==d||t[48]!==g||t[49]!==_||t[50]!==y||t[51]!==s||t[52]!==n?(D=_.length>0&&n.convertLocations?(0,Y.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=y===`link`?`copy`:`link`,r=_.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(Pt).join(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Zn as n}from"./DocumentContext-C7cdXT-e.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{i as u,n as d,t as f}from"./tooltip-DPvMEqsq.js";import{a as p,c as m,i as h,l as g,o as _,r as v,s as y}from"./alert-dialog-C8E8SkhJ.js";import{C as b,a as x,c as S,d as C,f as w,l as T,p as E,r as D,s as O,u as k}from"./terminal-cli-display-C-s_gqLX.js";import{a as A,d as j,f as M,i as N,n as P,o as F,p as I,u as L}from"./dropdown-menu-BpLbh79a.js";import{Yt as R,fo as z,ni as B,qt as V}from"./dist-DSS3ixln2.js";import{n as H}from"./dist-CuH7ikCn.js";import{c as ee}from"./documents-events-DCcMe0wm.js";import{t as U}from"./createLucideIcon-CAkY8Blx.js";import{c as W}from"./use-open-skill-BTISsK-W.js";import{t as te}from"./spinner-DmibE6UV.js";import{N as ne,S as re,j as G,x as K}from"./skills-api-BLXzXEC-.js";import{i as ie,l as ae,n as oe,r as q}from"./skill-scope-DWsJ838z.js";import{t as J}from"./use-skills-szHEgJLb.js";var Y=t(),X=e(r(),1),Z=o(),se=3100,ce=3;function le(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??ce;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ue={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},de=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function fe(e,t={}){let n=t.rng??Math.random,r=t.colors??de,i=ue[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var pe=1.8,me=90,he=16,ge=380,_e=.025,ve=.1,ye=.18,be=400,xe=9.2736,Se=18.1799,Ce=14.5244,we={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Te(e,t){let{halfWidth:n,apexLift:r}=we[t];return`M${e-n} ${Ce+.3} Q${e} ${Ce-r}, ${e+n} ${Ce+.3}`}function Ee(e){let t=1.5,n=.3;return`M${e-t} ${Ce-n} Q${e} ${Ce+1.4}, ${e+t} ${Ce-n}`}var De=15,Oe=15;function ke(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function Ae(e){let t=(0,Z.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,X.useRef)(null),g=(0,X.useRef)(null),_=(0,X.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,X.useRef)(v),[b,x]=(0,X.useState)(0),[S,C]=(0,X.useState)(0),[w,T]=(0,X.useState)(0),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[1]=E):E=t[1];let[D,O]=(0,X.useState)(E),k=(0,X.useRef)(0),A=(0,X.useRef)(0),j=(0,X.useRef)(void 0),M=p===`sleeping`,N;t[2]!==b||t[3]!==M||t[4]!==u?(N=function(){if(M)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=A.current===0?1/0:e-A.current;A.current=e;let n=le(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Ie),i||(O(fe(n)),n===3&&(k.current=e,T(Fe))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se)},t[2]=b,t[3]=M,t[4]=u,t[5]=N):N=t[5];let P=N,F,I;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>clearTimeout(j.current),I=[],t[6]=F,t[7]=I):(F=t[6],I=t[7]),(0,X.useEffect)(F,I);let L,R;t[8]!==m||t[9]!==M?(L=()=>{m===0||M||(x(3),C(Pe),O(fe(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Ne),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se))},R=[m,M],t[8]=m,t[9]=M,t[10]=L,t[11]=R):(L=t[10],R=t[11]),(0,X.useEffect)(L,R);let z,B;t[12]!==M||t[13]!==f?(z=()=>{if(!f||M||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/ge)),C=-Math.max(-1,Math.min(1,b/ge))*he,w=S*he,T=0,E=0;if(x>=1){let e=Math.min(x/me,1)*pe;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*ve,i+=(w-i)*ve,u.style.transform=`perspective(${be}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*ye,o+=(E-o)*ye;let O=i*_e,k=-r*_e,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},B=[f,M],t[12]=M,t[13]=f,t[14]=z,t[15]=B):(z=t[14],B=t[15]),(0,X.useEffect)(z,B);let V;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=V):V=t[16],(0,X.useLayoutEffect)(V);let H=b>0,ee=H?b:1,U=H?`ok-blob-clicked-${b}`:null,W;t[17]===r?W=t[18]:(W=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=W);let te=M?`cursor-default`:`cursor-pointer`,ne=`body-${S}`,re=M&&`ok-blob-sleeping`,G;t[19]!==U||t[20]!==re?(G=s(`ok-blob-group`,re,U),t[19]=U,t[20]=re,t[21]=G):G=t[21];let K;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Y.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=K):K=t[22];let ie=(H||M)&&`ok-blob-eye-hidden`,ae;t[23]===ie?ae=t[24]:(ae=s(`ok-blob-eye`,ie),t[23]=ie,t[24]=ae);let oe;t[25]===ae?oe=t[26]:(oe=(0,Y.jsx)(`ellipse`,{cx:xe,cy:Ce,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=oe);let q=(H||M)&&`ok-blob-eye-hidden`,J;t[27]===q?J=t[28]:(J=s(`ok-blob-eye ok-blob-eye-right`,q),t[27]=q,t[28]=J);let ce;t[29]===J?ce=t[30]:(ce=(0,Y.jsx)(`ellipse`,{cx:Se,cy:Ce,rx:1.2722,ry:1.9083,className:J}),t[29]=J,t[30]=ce);let ue;t[31]===ee?ue=t[32]:(ue=Te(xe,ee),t[31]=ee,t[32]=ue);let de=(!H||M)&&`ok-blob-eye-hidden`,we;t[33]===de?we=t[34]:(we=s(`ok-blob-happy-eye`,de),t[33]=de,t[34]=we);let De;t[35]!==ue||t[36]!==we?(De=(0,Y.jsx)(`path`,{d:ue,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:we}),t[35]=ue,t[36]=we,t[37]=De):De=t[37];let Oe;t[38]===ee?Oe=t[39]:(Oe=Te(Se,ee),t[38]=ee,t[39]=Oe);let ke=(!H||M)&&`ok-blob-eye-hidden`,Ae;t[40]===ke?Ae=t[41]:(Ae=s(`ok-blob-happy-eye`,ke),t[40]=ke,t[41]=Ae);let Le;t[42]!==Oe||t[43]!==Ae?(Le=(0,Y.jsx)(`path`,{d:Oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Ae}),t[42]=Oe,t[43]=Ae,t[44]=Le):Le=t[44];let Re;t[45]===M?Re=t[46]:(Re=M?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{d:Ee(xe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Y.jsx)(`path`,{d:Ee(Se),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Re);let ze;t[47]!==oe||t[48]!==ce||t[49]!==De||t[50]!==Le||t[51]!==Re?(ze=(0,Y.jsxs)(`g`,{ref:_,children:[oe,ce,De,Le,Re]}),t[47]=oe,t[48]=ce,t[49]=De,t[50]=Le,t[51]=Re,t[52]=ze):ze=t[52];let Q;t[53]!==ne||t[54]!==G||t[55]!==ze?(Q=(0,Y.jsxs)(`g`,{className:G,children:[K,ze]},ne),t[53]=ne,t[54]=G,t[55]=ze,t[56]=Q):Q=t[56];let Be;t[57]===M?Be=t[58]:(Be=M?(0,Y.jsxs)(`g`,{children:[(0,Y.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Y.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=M,t[58]=Be);let Ve;t[59]!==w||t[60]!==D?(Ve=D.length>0&&(0,Y.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(je)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=Ve):Ve=t[61];let He;t[62]!==P||t[63]!==d||t[64]!==te||t[65]!==Q||t[66]!==Be||t[67]!==Ve?(He=(0,Y.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:te,"aria-hidden":`true`,onClick:P,onMouseDown:Me,children:[Q,Be,Ve]}),t[62]=P,t[63]=d,t[64]=te,t[65]=Q,t[66]=Be,t[67]=Ve,t[68]=He):He=t[68];let Ue;return t[69]!==i||t[70]!==W||t[71]!==He?(Ue=(0,Y.jsx)(`span`,{ref:h,className:W,style:i,children:He}),t[69]=i,t[70]=W,t[71]=He,t[72]=Ue):Ue=t[72],Ue}function je(e){return(0,Y.jsx)(`circle`,{cx:De+e.originDx,cy:Oe+e.originDy,r:e.size,className:`ok-blob-firework`,style:ke(e)},e.id)}function Me(e){return e.preventDefault()}function Ne(e){return e+1}function Pe(e){return e+1}function Fe(e){return e+1}function Ie(e){return e+1}var Le=U(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Re=U(`file-plus`,[[`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`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),ze=U(`settings`,[[`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`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q=[...new Set(b.flatMap(e=>e.schemes))];function Be(e,t){let n=t.now?.()??Date.now(),r={};for(let t of b){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Ve(e){return Be({},e)}async function He(e){let t=e.schemes??Q,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ue=Object.fromEntries(Q.map(e=>[e,{installed:!1}]));async function We(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ue}if(!t.ok)return Ue;let n;try{n=await t.json()}catch{return Ue}if(typeof n!=`object`||!n||Array.isArray(n))return Ue;let r=n,i={};for(let e of Q)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Ge(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Ke(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Ve({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Be(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Ge(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function qe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Je(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>He({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>We({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ye(){let e=(0,Z.c)(5),[t,n]=(0,X.useState)(Xe),r=(0,X.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ke(Je());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,X.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Xe(){return Ve({isElectronHost:qe(),now:Date.now})}var Ze=(0,X.createContext)(null);function Qe(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Y.jsx)(Ze,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function $e(){return(0,X.use)(Ze)}function et(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function tt(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function nt(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if(tt(e))return;throw t}if(!tt(e))throw Error(`clipboard API unavailable`)}function rt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:b}=e,{_:x}=a(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==d?(w=d??x({id:`cnGeoo`}),t[3]=x,t[4]=d,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==d||t[8]!==f?(E=f??d??x({id:`s3caR3`}),t[6]=x,t[7]=d,t[8]=f,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==s||t[12]!==C?(O=s??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=s,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Y.jsx)(g,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==c||t[18]!==C?(A=c??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=c,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Y.jsx)(_,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===u?M=t[23]:(M=u?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Y.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Y.jsx)(v,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Y.jsx)(i,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===r?I=t[32]:(I=(0,Y.jsx)(h,{disabled:r,children:F}),t[31]=r,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==r?(L=r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(te,{"aria-hidden":`true`,className:`size-4`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=r,t[36]=L):L=t[36];let R;t[37]!==r||t[38]!==o||t[39]!==L?(R=(0,Y.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:L}),t[37]=r,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Y.jsxs)(y,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Y.jsxs)(p,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function it(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:z[e]??e}function at(e){return e===`claude`?`claude-code`:e}function ot(e){let t=(0,Z.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,Y.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,Y.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,Y.jsx)(Ae,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,Y.jsx)(W,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=at(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,Y.jsx)(D,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function st(e){let t=(0,Z.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let p;t[8]===i?p=t[9]:(p=e=>(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,Y.jsx)(ot,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":it(e)})})}),(0,Y.jsx)(d,{children:it(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,Y.jsx)(d,{children:l.map(it).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,Y.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function ct(e){let t=(0,Z.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function lt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(O,{...r}):(0,Y.jsx)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ut(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(S,{...r}):(0,Y.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function dt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(x,{...r}):(0,Y.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ft(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(T,{...r}):(0,Y.jsx)(F,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(k,{...r}):(0,Y.jsx)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function mt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(C,{...r}):(0,Y.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ht(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(w,{...r}):(0,Y.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function gt(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(E,{...r}):(0,Y.jsx)(I,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var _t=Object.freeze({hosts:null,source:null}),vt=new Map,yt=new Map;function bt(e,t){return`${e}:${t}`}function xt(e){return vt.get(e)??_t}function St(e,t){let n=yt.get(e)??new Set;return yt.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&yt.delete(e)}}function Ct(e,t){let n=xt(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?vt.delete(e):vt.set(e,r);for(let t of yt.get(e)??[])t()}}var wt=V.options,Tt=R.options,Et=`.agents/`;function Dt({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${ae(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(Et))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=e?.scope===`global`?Tt:wt,d=(o?[...u,`agents`]:u).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),f=new Set(d.map(e=>a(e))),p=e?.scope===`global`?`~/`:``,m=e?.path?.includes(`/`)?`${p}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,h=m!==null&&!f.has(m)?m:null,g=h===null?r??e?.hosts?.[0]:void 0,_=new Set(e?.conflictHosts??[]),v=new Set(e?.driftPaths??[]),y=new Set(e?.symlinkedHosts??[]),b=[...[...n].filter(e=>e!==g&&!(e in s)&&!_.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:y.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:q(e),display:`${p}${e.path}`,mode:e.mode}))],x=b.map(e=>e.mode),S=x.filter(e=>e===`link`).length,C=x.length===0?i?`link`:`copy`:S*2>=x.length?`link`:`copy`,w=new Map((e?.customPlacements??[]).map(e=>[q(e),e])),T=new Set(w.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=q(e);t!==``&&T.add(t)}}return{pathFor:a,aliases:s,rows:d,sourceRow:h,sourceHost:g,conflicted:_,drifted:v,linked:y,expectedMode:C,convertible:b,customRootRows:e===void 0?[]:[...T].sort().map(t=>({root:t,display:`${p}${t}/${e.name}`,placed:w.get(t)??null})).filter(e=>!f.has(e.display)&&e.display!==m&&!(e.root in s))}}var Ot=`min-w-[24rem]`;function kt(e,t){let n=(0,Z.c)(45),r=t.installingName===e.name,i=(0,X.useRef)(e),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,X.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,X.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=bt(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>St(m,e),g=()=>xt(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,X.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&Ct(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,X.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,X.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,X.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==m||n[26]!==j?(M=()=>{let e=xt(m).hosts;e&&[...e].sort().join(`,`)===j&&Ct(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,X.useEffect)(M,N);let P=(0,X.useRef)(null),F=(0,X.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,X.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,Ct(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(B));if(!r.ok){Ct(m,{hosts:null});return}D.current=[...r.hosts],Ct(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,V;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(V={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=e.scope===`global`?Tt:wt,n=D.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||D.current.includes(e));z([...n,...i],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>K({scope:e.scope,name:e.name,dir:n,mode:r})).then(jt)},unplaceAt(n){t.runLocationWrite(e,()=>ne({scope:e.scope,name:e.name,path:n})).then(At)},setSource(n){Ct(m,{source:n}),t.runLocationWrite(e,()=>G({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Ct(m,{source:null}),H.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=V):V=n[44],V}function At(e){e.ok||H.error(e.error)}function jt(e){e.ok||H.error(e.error)}function $(e){let t=(0,Z.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Y.jsx)(u,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Y.jsx)(d,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Y.jsxs)(f,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Mt(e){let t=(0,Z.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:s,menuKind:c}=e,u=c===void 0?`dropdown`:c,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:m}=n,h=J(),g,_,v,y,b,x,S,C,w,T;if(t[0]!==d||t[1]!==h.data||t[2]!==h.status||t[3]!==f||t[4]!==m||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:c,sourceRow:E,sourceHost:D,conflicted:O,drifted:k,linked:A,expectedMode:j,convertible:M,customRootRows:N}=Dt({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=c,x=E,y=j,_=M,v=N;let P=e=>oe(a,e),F=zt,I=e=>{let t=P(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(F).join(`, `),rootRel:e}}))},L;t[21]!==d||t[22]!==r?(L=(e,t)=>{let n=e.includes(`/`)?e:ae(e,r?.scope??`project`);return(0,Y.jsx)($,{hint:d({id:`0dslv8`,values:{0:F(e),1:F(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:F(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:F(e),1:r.name,2:F(e),subRoot:n,poolRootRel:t}}))&&re({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?ee():H.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Y.jsx)(ot,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=L):L=t[23];let R=L;g=n.installing;let B=ie(r),V=Rt,U;t[24]!==d||t[25]!==s||t[26]!==n?(U=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,Y.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(s?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Y.jsx)(i,{id:`uUCrBv`}):(0,Y.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=s,t[26]=n,t[27]=U):U=t[27];let te=U,ne;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Y.jsx)(i,{id:`npcziF`}),t[28]=ne):ne=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===m?K=t[32]:(K=()=>m(),t[31]=m,t[32]=K);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Y.jsx)(i,{id:`N40H-G`}),t[33]=q):q=t[33];let J;t[34]!==g||t[35]!==K?(J=(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:g,onClick:K,"data-testid":`skill-install-all`,children:q}),t[34]=g,t[35]=K,t[36]=J):J=t[36];let X;t[37]!==G||t[38]!==J?(X=(0,Y.jsx)($,{hint:G,children:J}),t[37]=G,t[38]=J,t[39]=X):X=t[39],t[40]!==u||t[41]!==X?(S=(0,Y.jsxs)(ft,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[ne,X]}),t[40]=u,t[41]=X,t[42]=S):S=t[42],C=x===null?null:(0,Y.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,Y.jsxs)(dt,{menuKind:u,disabled:g,checked:!0,onSelect:Lt,"data-testid":`skill-source-row`,children:[(0,Y.jsx)(W,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:x}),(()=>{let e=V(x).split(`/`).slice(0,-1).join(`/`),t=P(e);return t.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>R(t,e))}):null})(),(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})})]})]})}),w=b.map(t=>{let a=e(t),s=t===`agents`?`.agents`:z[t],c=V(a).split(`/`).slice(0,-1).join(`/`),m=P(c);return(0,Y.jsx)($,{hint:O.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===D?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):B?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:B.plugin,2:a??s,label:s}}):d(a?D===void 0?{id:`xk133d`,values:{path:a}}:y===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,Y.jsxs)(dt,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{O.has(t)||e===!0&&!I(c)||p(t,e===!0)},onSelect:It,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Y.jsx)(ot,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??s}),m.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:m.map(e=>R(e,c))}):null,B?.editor===t&&!f.has(t)?(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,Y.jsx)(i,{id:`scRzTw`})}):null,O.has(t)?(0,Y.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Y.jsx)(i,{id:`jng7Ko`})})}):t===D?(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,Y.jsxs)(Y.Fragment,{children:[!g&&(A.has(t)?`link`:`copy`)!==y?te(t,a??s,A.has(t)?`link`:`copy`):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]}):null,!g&&k.has(V(a))?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(ct,{testId:`skill-drift-${t}`})}):null]})]})},t)}),T=v.map(e=>{let t=e.display;return(0,Y.jsx)($,{hint:e.placed===null?d(D===void 0?{id:`xk133d`,values:{path:t}}:y===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,Y.jsxs)(dt,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!I(e.root))return;n.placeAt(e.root,y)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Ft,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Y.jsx)(ot,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Y.jsx)(W,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),P(e.root).length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:P(e.root).map(t=>R(t,e.root))}):null,!g&&e.placed!==null&&k.has(e.placed.path)?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(ct,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Y.jsxs)(Y.Fragment,{children:[!g&&e.placed.mode!==y?te(e.root,e.display,e.placed.mode):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=d,t[1]=h.data,t[2]=h.status,t[3]=f,t[4]=m,t[5]=u,t[6]=o,t[7]=s,t[8]=r,t[9]=p,t[10]=n,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20];let E;t[43]!==v||t[44]!==b.length||t[45]!==x?(E=b.length===0&&v.length===0&&x===null?(0,Y.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Y.jsx)(i,{id:`MOAoFO`})}):null,t[43]=v,t[44]=b.length,t[45]=x,t[46]=E):E=t[46];let D;t[47]!==d||t[48]!==g||t[49]!==_||t[50]!==y||t[51]!==s||t[52]!==n?(D=_.length>0&&n.convertLocations?(0,Y.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=y===`link`?`copy`:`link`,r=_.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(Pt).join(`
2
2
  `);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${d({id:`Cu6GXQ`})}`)&&(s?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:g,"data-testid":`skill-convert-all`,children:y===`link`?(0,Y.jsx)(i,{id:`rcJmK8`}):(0,Y.jsx)(i,{id:`LBv_TR`})}),(0,Y.jsx)($,{hint:d({id:`0J6nhG`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,"aria-label":d({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:Nt,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[47]=d,t[48]=g,t[49]=_,t[50]=y,t[51]=s,t[52]=n,t[53]=D):D=t[53];let O;t[54]===u?O=t[55]:(O=(0,Y.jsx)(pt,{menuKind:u}),t[54]=u,t[55]=O);let k;t[56]===d?k=t[57]:(k=d({id:`5ymuTA`}),t[56]=d,t[57]=k);let A;t[58]===r?.scope?A=t[59]:(A=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=r?.scope,t[59]=A);let j,M;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Y.jsx)(ze,{"aria-hidden":!0}),M=(0,Y.jsx)(i,{id:`ZBF9fn`}),t[60]=j,t[61]=M):(j=t[60],M=t[61]);let N;t[62]!==u||t[63]!==A?(N=(0,Y.jsxs)(ut,{menuKind:u,onSelect:A,children:[j,M]}),t[62]=u,t[63]=A,t[64]=N):N=t[64];let P;t[65]!==N||t[66]!==k?(P=(0,Y.jsx)($,{hint:k,children:N}),t[65]=N,t[66]=k,t[67]=P):P=t[67];let F;return t[68]!==P||t[69]!==S||t[70]!==C||t[71]!==w||t[72]!==T||t[73]!==E||t[74]!==D||t[75]!==O?(F=(0,Y.jsxs)(Y.Fragment,{children:[S,C,w,T,E,D,O,P]}),t[68]=P,t[69]=S,t[70]=C,t[71]=w,t[72]=T,t[73]=E,t[74]=D,t[75]=O,t[76]=F):F=t[76],F}function Nt(e){return e.preventDefault()}function Pt(e){return e.display}function Ft(e){return e.preventDefault()}function It(e){return e.preventDefault()}function Lt(e){return e.preventDefault()}function Rt(e){return(e??``).replace(/^~\//,``)}function zt(e){return e===`agents`?`.agents`:z[e]??e}export{ze as C,Ae as E,Ye as S,Le as T,rt as _,wt as a,Qe as b,ft as c,ht as d,gt as f,it as g,st as h,Tt as i,pt as l,ot as m,Mt as n,lt as o,ct as p,kt as r,ut as s,Ot as t,mt as u,et as v,Re as w,$e as x,nt as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{T as s}from"./SkillInstallMenu-qZYVaUQ-.js";import{t as c}from"./button-CA0dewJJ.js";import{a as l,m as u,r as d,t as f,u as p}from"./dropdown-menu-BpLbh79a.js";import{a as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./select-fWSYgcDA.js";import{l as x,n as S,r as C,t as w}from"./AddPropertiesButton-CW8Aw1Ow.js";import{t as T}from"./list-plus-1_iMFVqs.js";import{p as E,t as D}from"./skill-scope-DWsJ838z.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:l}=i(),u=E(),d;t[0]===a?d=t[1]:(d=e=>a(e),t[0]=a,t[1]=d);let f;t[2]===l?f=t[3]:(f=l({id:`oCHfGC`}),t[2]=l,t[3]=f);let p;t[4]===c?p=t[5]:(p=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=p);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(y,{}),t[6]=x):x=t[6];let S;t[7]!==f||t[8]!==p?(S=(0,k.jsx)(_,{size:`sm`,"aria-label":f,"data-testid":`skill-level-select`,className:p,children:x}),t[7]=f,t[8]=p,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(m,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===u?w=t[12]:(w=D.map(e=>(0,k.jsx)(h,{value:e,children:u[e]},e)),t[11]=u,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(g,{align:`end`,children:(0,k.jsxs)(v,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==s||t[16]!==d||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(b,{value:n,onValueChange:d,disabled:s,children:[S,T]}),t[15]=s,t[16]=d,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,k.jsx)(x,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:m,problemCount:h,problemMessages:g}=e,{_}=i(),v;t[0]!==a||t[1]!==n?(v={scope:n,name:a},t[0]=a,t[1]=n,t[2]=v):v=t[2];let y=M(v),b;t[3]!==y.requestMove||t[4]!==n?(b=(0,k.jsx)(A,{value:n,onRequestMove:y.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=y.requestMove,t[4]=n,t[5]=b):b=t[5];let x;t[6]!==a||t[7]!==n?(x=(0,k.jsx)(C,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=x):x=t[8];let E;t[9]!==b||t[10]!==x?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b,x]}),t[9]=b,t[10]=x,t[11]=E):E=t[11];let D;t[12]!==m||t[13]!==h||t[14]!==g||t[15]!==o?(D=o?(0,k.jsx)(w,{onAddProperty:m,problemCount:h,problemMessages:g,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=m,t[13]=h,t[14]=g,t[15]=o,t[16]=D):D=t[16];let j;t[17]===_?j=t[18]:(j=_({id:`Yzs3QX`}),t[17]=_,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(u,{asChild:!0,children:(0,k.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===y?F=t[23]:(F=e=>y.requestMove(e),t[22]=y,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(S,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==m||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(p,{}),(0,k.jsxs)(l,{onSelect:m,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=m,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(d,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(f,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==y.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,y.dialog]}),t[36]=y.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{T as s}from"./SkillInstallMenu-C0acjJLL.js";import{t as c}from"./button-CA0dewJJ.js";import{a as l,m as u,r as d,t as f,u as p}from"./dropdown-menu-BpLbh79a.js";import{a as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./select-fWSYgcDA.js";import{l as x,n as S,r as C,t as w}from"./AddPropertiesButton-CvbHqm7d.js";import{t as T}from"./list-plus-1_iMFVqs.js";import{p as E,t as D}from"./skill-scope-DWsJ838z.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:l}=i(),u=E(),d;t[0]===a?d=t[1]:(d=e=>a(e),t[0]=a,t[1]=d);let f;t[2]===l?f=t[3]:(f=l({id:`oCHfGC`}),t[2]=l,t[3]=f);let p;t[4]===c?p=t[5]:(p=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=p);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(y,{}),t[6]=x):x=t[6];let S;t[7]!==f||t[8]!==p?(S=(0,k.jsx)(_,{size:`sm`,"aria-label":f,"data-testid":`skill-level-select`,className:p,children:x}),t[7]=f,t[8]=p,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(m,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===u?w=t[12]:(w=D.map(e=>(0,k.jsx)(h,{value:e,children:u[e]},e)),t[11]=u,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(g,{align:`end`,children:(0,k.jsxs)(v,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==s||t[16]!==d||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(b,{value:n,onValueChange:d,disabled:s,children:[S,T]}),t[15]=s,t[16]=d,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,k.jsx)(x,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:m,problemCount:h,problemMessages:g}=e,{_}=i(),v;t[0]!==a||t[1]!==n?(v={scope:n,name:a},t[0]=a,t[1]=n,t[2]=v):v=t[2];let y=M(v),b;t[3]!==y.requestMove||t[4]!==n?(b=(0,k.jsx)(A,{value:n,onRequestMove:y.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=y.requestMove,t[4]=n,t[5]=b):b=t[5];let x;t[6]!==a||t[7]!==n?(x=(0,k.jsx)(C,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=x):x=t[8];let E;t[9]!==b||t[10]!==x?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b,x]}),t[9]=b,t[10]=x,t[11]=E):E=t[11];let D;t[12]!==m||t[13]!==h||t[14]!==g||t[15]!==o?(D=o?(0,k.jsx)(w,{onAddProperty:m,problemCount:h,problemMessages:g,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=m,t[13]=h,t[14]=g,t[15]=o,t[16]=D):D=t[16];let j;t[17]===_?j=t[18]:(j=_({id:`Yzs3QX`}),t[17]=_,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(u,{asChild:!0,children:(0,k.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===y?F=t[23]:(F=e=>y.requestMove(e),t[22]=y,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(S,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==m||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(p,{}),(0,k.jsxs)(l,{onSelect:m,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=m,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(d,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(f,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==y.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,y.dialog]}),t[36]=y.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{$t as n,An as r,Ft as i,Lt as a,Tn as o,U as s,ct as c,en as l,gn as u,lt as d,mn as f,ot as p,pt as m,vt as h,yt as g}from"./DocumentContext-Cvt0LP7f.js";import{t as _}from"./react-f2sANaYj.js";import{n as v}from"./dist-PQ5KMVDh.js";import{t as ee}from"./compiler-runtime-BfE3aGVn.js";import{J as y,M as b,X as x,a as te,b as S,i as ne,o as re}from"./CodeMirrorPropInput-wxzi2HMF.js";import{Co as C,No as w,T as ie,Xi as ae,_o as T,ai as E}from"./dist-DSS3ixln2.js";import{i as oe}from"./use-apply-config-theme-B1eLRQeV.js";import{L as se,M as ce,O as le,P as ue,S as D,d as O,f as de,i as fe,j as pe,l as me,r as he,t as ge,w as k}from"./typing-burst-detector-B3y1Rq0N.js";import"./config-provider-BkCITdUN.js";import{$ as A,D as j,Dt as M,F as N,It as P,Lt as F,Ot as I,Pt as L,Y as R,Z as z,b as B,ct as V,ft as _e,g as H,gt as U,ht as ve,it as W,kt as ye,l as G,lt as K,nt as q,pt as J,rt as Y,ut as X,v as Z}from"./dist-EbTHn-HD.js";import{a as be,n as xe}from"./cm-theme-CqnwWjn0.js";import{i as Se,n as Ce,o as we,r as Te}from"./dist-ezYezphN.js";import{o as Ee,r as De}from"./selection-context-OMBgzLme.js";import{l as Oe}from"./lint-config-client-CumTSl-t.js";import{a as ke,i as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe}from"./dist-BFkXO51e2.js";import{n as Ie,t as Le}from"./src-BhVr0kka.js";var Q=e(_(),1),Re=ee();function ze(){let e=h();return e===null?null:new Set(e.keys())}function Be(e,t,n){let r=[],i=N(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);C.lastIndex=0;for(let e=C.exec(t);e!==null;e=C.exec(t)){let t=e[2];if(!w(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(R.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,s=i.slice(a,i.length-o),c=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(s)?.[1];if(c!==void 0&&w(c)&&n!=null)return r.push(R.mark({class:n.has(c)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":c}}).range(t.from+a,t.to-o)),!1;let l=p.exec(s);if(l)return r.push(R.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":l[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(r)}function Ve(e){let t=d(e);return t===null?[]:[A.fromClass(class{decorations;constructor(e){this.decorations=Be(e.state,e.visibleRanges,ze())}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=Be(e.view.state,e.view.visibleRanges,ze()))}},{decorations:e=>e.decorations}),z.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),i=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(i!==void 0){n.preventDefault();let e=h()?.get(i);return e===void 0?m():window.location.hash=g(i,e),!0}let a=n.target?.closest?.(`.cm-skill-path-link`),o=a instanceof HTMLElement?a.dataset.skillPath:void 0;return o===void 0?!1:(n.preventDefault(),window.location.hash=c(t,e,o),!0)}})]}var He=R.line({attributes:{dir:`auto`}});function Ue(e){let t=new L;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,He),r=n.to+1}return t.finish()}var We=A.fromClass(class{decorations;constructor(e){this.decorations=Ue(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ue(e.view))}},{decorations:e=>e.decorations}),Ge=[z.perLineTextDirection.of(!0),We],Ke=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),qe=`cm-lint-local-target`;function Je(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Ye(e,t){let n=H(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Ke.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Xe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function Ze(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ye(e,Je(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Xe(i.severity),message:k(i),source:`${i.source}/${i.code}`,markClass:qe})}return r}var Qe=P.define();function $e(e){let t={findings:[]};return[Ae(e=>y()?Ze(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(Qe)))}),A.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:Qe.of(null)}),Fe(n)},i=D(e,e=>{e.status===`loaded`&&r(e.findings)}),a=x(()=>r(t.findings));return{destroy(){i(),a()}}})]}function et(e,t){return e.enabled?[je(),Ae(async n=>tt(n.state.doc,await E(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function tt(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=nt(r);o&&(a.actions=[o]),n.push(a)}return n}function nt(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var rt=[J(),K(),X(),Z(),Y(),W(),ye.allowMultipleSelections.of(!0),j(),G(),Te(),Ce(),U(),q(),V(),ke(),_e.of([...Se,...xe,...Pe,...B,...we,...Ne])],it=R.mark({class:`cm-link-ref-broken`}),at=/^\s{0,3}\[([^\]]+)\]:\s/,ot=/\[([^\]]*)\]\[([^\]]*)\]/g,st=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ct(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function lt(e){let t=[];return N(e).iterate({enter(e){if(st.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function ut(e){let t=new Set,n=[],r=e.doc,i=lt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ct(n.from,i))continue;let a=at.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ct(t.from,i)&&!at.test(t.text))for(ot.lastIndex=0;;){let e=ot.exec(t.text);if(!e)break;let r=t.from+e.index;if(ct(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(it.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),R.set(a)}var dt=F.define({create(e){return ut(e)},update(e,t){return t.docChanged?ut(t.state):e},provide:e=>z.decorations.from(e)}),ft=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,pt=R.mark({class:`cm-del`}),mt=R.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),ht=R.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function gt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function _t(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!T.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(T.test(r.text))return{from:t.from,to:r.to}}return null}function vt(e,t){let n=[],r=N(e),i=_t(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(pt.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=ft.exec(r.text),a=i?i[1].length:2,o=R.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=gt(r.text),a=R.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(mt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(n)}var yt=class{decorations;constructor(e){this.decorations=vt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=vt(e.view.state,e.view.visibleRanges))}},bt=A.fromClass(yt,{decorations:e=>e.decorations});function xt(){return[bt,dt]}var St=t(),Ct=P.define();function wt(e,t,n){let i=O(e.state.doc)[t.index];i&&r(n,()=>{e.dispatch({selection:I.cursor(i.from),effects:z.scrollIntoView(i.from,{y:`start`})}),e.focus()})}function Tt(e,t,n,i){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);r(i,()=>{e.dispatch({selection:I.cursor(o),effects:z.scrollIntoView(o,{y:`center`})}),e.focus()})})}function Et(e,t,n){let i=e.state.doc,a=Math.min(Math.max(t.line,1),i.lines),o=i.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);r(n,()=>{e.dispatch({selection:I.cursor(s),effects:z.scrollIntoView(s,{y:`start`})}),e.focus()})}function Dt(e){let t=(0,Re.c)(50),{docName:r,ytext:c,provider:d,placeholder:p,isSourceModeActive:m}=e,h=(0,Q.useRef)(null),g=(0,Q.useRef)(null),[_,ee]=(0,Q.useState)(null);if(_)throw _;let{resolvedTheme:y}=v(),{merged:b}=oe(),x=(0,Q.useRef)(m),S=b?.editor?.wordWrap??!0,{data:C}=Oe(r),w;t[0]!==C?.effective||t[1]!==b?(w=C?.effective??(b?.contentRules?ae(b.contentRules):ie),t[0]=C?.effective,t[1]=b,t[2]=w):w=t[2];let T=w,E;t[3]===T?E=t[4]:(E=JSON.stringify(T),t[3]=T,t[4]=E);let D=E,O,k;t[5]===m?(O=t[6],k=t[7]):(O=()=>{x.current=m},k=[m],t[5]=m,t[6]=O,t[7]=k),(0,Q.useEffect)(O,k);let A=(0,Q.useRef)(null),j;t[8]!==r||t[9]!==T||t[10]!==p||t[11]!==d||t[12]!==y||t[13]!==S||t[14]!==c?(j=()=>{let e=h.current;if(!e)return;let t=d.configuration.name??``,m,_=kt;try{m=n({docName:t,container:e,sizeStats:{viewCount:0,bytes:c.length},factory:e=>{let n=null,l=s({ydoc:d.document,ytext:c,docName:t}),u=new M,f=new M,m=new M,h=new M,g=new z({state:ye.create({doc:c.toString(),extensions:[rt,Ge,Me({scrollToMatch:e=>o(t)?z.scrollIntoView(e,{y:`start`}):Ct.of(null)}),_e.of([be]),Le(c,d.awareness),_e.of(Ie),...ne({themeCompartment:u,resolvedTheme:y,ydoc:d.document,wordWrapCompartment:f,wordWrap:S,currentDocName:t}),xt(),Ve(t),se(),h.of(et(T,r)),$e(r),l,z.updateListener.of(e=>{i(e)&&a(t)}),z.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,he(t,`source`,fe(e.view)),De(t,`source`,Ee(e.view,t))},120))}),m.of(ve(p??``)),z.theme({"&":{height:`100%`}}),z.scrollMargins.of(Ot)]}),parent:e});he(t,`source`,fe(g)),De(t,`source`,Ee(g,t));let v=g.contentDOM;return v.addEventListener(`keydown`,_),v.addEventListener(`paste`,_),v.addEventListener(`drop`,_),v.addEventListener(`cut`,_),{view:g,ydoc:d.document,ytext:c,provider:d,themeCompartment:u,wordWrapCompartment:f,placeholderCompartment:m,lintCompartment:h}}}),A.current=m,g.current=m.view,f(r,m.view),ge()&&m.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),A.current=null,g.current=null,ee(t instanceof Error?t:Error(String(t)))}return()=>{let e=A.current;e&&(l(e),u(r,e.view)),A.current=null,g.current=null}},t[8]=r,t[9]=T,t[10]=p,t[11]=d,t[12]=y,t[13]=S,t[14]=c,t[15]=j):j=t[15];let N;t[16]!==d||t[17]!==c?(N=[c,d],t[16]=d,t[17]=c,t[18]=N):N=t[18],(0,Q.useEffect)(j,N);let P,F;t[19]===r?(P=t[20],F=t[21]):(P=()=>{},F=[r],t[19]=r,t[20]=P,t[21]=F),(0,Q.useEffect)(P,F);let I,L;t[22]===y?(I=t[23],L=t[24]):(L=()=>{let e=A.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(y===`dark`?te:re)})},I=[y],t[22]=y,t[23]=I,t[24]=L),(0,Q.useEffect)(L,I);let R,B;t[25]===S?(R=t[26],B=t[27]):(R=()=>{let e=A.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(S?z.lineWrapping:[])})},B=[S],t[25]=S,t[26]=R,t[27]=B),(0,Q.useEffect)(R,B);let V,H;t[28]===p?(V=t[29],H=t[30]):(V=()=>{let e=A.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(p??``))})},H=[p],t[28]=p,t[29]=V,t[30]=H),(0,Q.useEffect)(V,H);let U;t[31]!==r||t[32]!==T?(U=()=>{let e=A.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(et(T,r))})},t[31]=r,t[32]=T,t[33]=U):U=t[33];let W;t[34]===D?W=t[35]:(W=[D],t[34]=D,t[35]=W),(0,Q.useEffect)(U,W);let G,K;t[36]!==r||t[37]!==m?(G=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||t.mode!==`source`||!m)return;let n=g.current;n&&(wt(n,t,r),pe(r))};return window.addEventListener(me,e),()=>window.removeEventListener(me,e)},K=[r,m],t[36]=r,t[37]=m,t[38]=G,t[39]=K):(G=t[38],K=t[39]),(0,Q.useEffect)(G,K);let q,J;t[40]!==r||t[41]!==m?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||!m)return;let n=g.current;n&&(Et(n,t,r),pe(r))};return window.addEventListener(de,e),()=>window.removeEventListener(de,e)},J=[r,m],t[40]=r,t[41]=m,t[42]=q,t[43]=J):(q=t[42],J=t[43]),(0,Q.useEffect)(q,J);let Y,X;t[44]!==r||t[45]!==m||t[46]!==d?(Y=()=>{if(!m)return;let e=g.current;if(!e)return;let t=ue(r);if(!t)return;if(t.kind!==`selection-offset`){ce(r),t.kind===`outline`?wt(e,t.detail,r):t.kind===`lint`?Et(e,t.detail,r):t.kind===`raw-mdx`&&Tt(e,t.detail,()=>x.current,r);return}let n=!1,i=null;return queueMicrotask(()=>{if(n)return;let t=ue(r);t?.kind===`selection-offset`&&(i=le({view:e,docName:r,navigation:t,ydoc:d.document,transition:{from:`wysiwyg`,to:`source`}}),i&&ce(r))}),()=>{n=!0,i?.cancel(`mode-flip`)}},X=[r,m,d],t[44]=r,t[45]=m,t[46]=d,t[47]=Y,t[48]=X):(Y=t[47],X=t[48]),(0,Q.useEffect)(Y,X);let Z;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,St.jsx)(`div`,{ref:h,className:`source-editor h-full pb-3`}),t[49]=Z):Z=t[49],Z}function Ot(){return{top:S()}}function kt(){return b()}export{Dt as SourceEditor,Tt as applyRawMdxNavigation};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{$t as n,An as r,Ft as i,Lt as a,Tn as o,U as s,ct as c,en as l,gn as u,lt as d,mn as f,ot as p,pt as m,vt as h,yt as g}from"./DocumentContext-C7cdXT-e.js";import{t as _}from"./react-f2sANaYj.js";import{n as v}from"./dist-PQ5KMVDh.js";import{t as ee}from"./compiler-runtime-BfE3aGVn.js";import{J as y,M as b,X as x,a as te,b as S,i as ne,o as re}from"./CodeMirrorPropInput-B2m6_Glf.js";import{Co as C,No as w,T as ie,Xi as ae,_o as T,ai as E}from"./dist-DSS3ixln2.js";import{i as oe}from"./use-apply-config-theme-B1eLRQeV.js";import{C as D,F as se,M as ce,N as le,R as ue,T as O,f as k,i as de,k as fe,p as pe,r as me,t as he,u as ge}from"./typing-burst-detector-hl4Mjwn6.js";import"./config-provider-CRIf4i0O.js";import{$ as A,D as j,Dt as M,F as N,It as P,Lt as F,Ot as I,Pt as L,Y as R,Z as z,b as B,ct as V,ft as _e,g as H,gt as U,ht as ve,it as W,kt as ye,l as G,lt as K,nt as q,pt as J,rt as Y,ut as X,v as Z}from"./dist-EbTHn-HD.js";import{a as be,n as xe}from"./cm-theme-CqnwWjn0.js";import{i as Se,n as Ce,o as we,r as Te}from"./dist-ezYezphN.js";import{o as Ee,r as De}from"./selection-context-CFDH0uJe.js";import{l as Oe}from"./lint-config-client-CumTSl-t.js";import{a as ke,i as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe}from"./dist-BFkXO51e2.js";import{n as Ie,t as Le}from"./src-Bhg0wW5z.js";var Q=e(_(),1),Re=ee();function ze(){let e=h();return e===null?null:new Set(e.keys())}function Be(e,t,n){let r=[],i=N(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);C.lastIndex=0;for(let e=C.exec(t);e!==null;e=C.exec(t)){let t=e[2];if(!w(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(R.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,s=i.slice(a,i.length-o),c=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(s)?.[1];if(c!==void 0&&w(c)&&n!=null)return r.push(R.mark({class:n.has(c)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":c}}).range(t.from+a,t.to-o)),!1;let l=p.exec(s);if(l)return r.push(R.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":l[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(r)}function Ve(e){let t=d(e);return t===null?[]:[A.fromClass(class{decorations;constructor(e){this.decorations=Be(e.state,e.visibleRanges,ze())}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=Be(e.view.state,e.view.visibleRanges,ze()))}},{decorations:e=>e.decorations}),z.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),i=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(i!==void 0){n.preventDefault();let e=h()?.get(i);return e===void 0?m():window.location.hash=g(i,e),!0}let a=n.target?.closest?.(`.cm-skill-path-link`),o=a instanceof HTMLElement?a.dataset.skillPath:void 0;return o===void 0?!1:(n.preventDefault(),window.location.hash=c(t,e,o),!0)}})]}var He=R.line({attributes:{dir:`auto`}});function Ue(e){let t=new L;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,He),r=n.to+1}return t.finish()}var We=A.fromClass(class{decorations;constructor(e){this.decorations=Ue(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ue(e.view))}},{decorations:e=>e.decorations}),Ge=[z.perLineTextDirection.of(!0),We],Ke=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),qe=`cm-lint-local-target`;function Je(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Ye(e,t){let n=H(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Ke.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Xe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function Ze(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ye(e,Je(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Xe(i.severity),message:O(i),source:`${i.source}/${i.code}`,markClass:qe})}return r}var Qe=P.define();function $e(e){let t={findings:[]};return[Ae(e=>y()?Ze(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(Qe)))}),A.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:Qe.of(null)}),Fe(n)},i=D(e,e=>{e.status===`loaded`&&r(e.findings)}),a=x(()=>r(t.findings));return{destroy(){i(),a()}}})]}function et(e,t){return e.enabled?[je(),Ae(async n=>tt(n.state.doc,await E(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function tt(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=nt(r);o&&(a.actions=[o]),n.push(a)}return n}function nt(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var rt=[J(),K(),X(),Z(),Y(),W(),ye.allowMultipleSelections.of(!0),j(),G(),Te(),Ce(),U(),q(),V(),ke(),_e.of([...Se,...xe,...Pe,...B,...we,...Ne])],it=R.mark({class:`cm-link-ref-broken`}),at=/^\s{0,3}\[([^\]]+)\]:\s/,ot=/\[([^\]]*)\]\[([^\]]*)\]/g,st=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ct(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function lt(e){let t=[];return N(e).iterate({enter(e){if(st.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function ut(e){let t=new Set,n=[],r=e.doc,i=lt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ct(n.from,i))continue;let a=at.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ct(t.from,i)&&!at.test(t.text))for(ot.lastIndex=0;;){let e=ot.exec(t.text);if(!e)break;let r=t.from+e.index;if(ct(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(it.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),R.set(a)}var dt=F.define({create(e){return ut(e)},update(e,t){return t.docChanged?ut(t.state):e},provide:e=>z.decorations.from(e)}),ft=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,pt=R.mark({class:`cm-del`}),mt=R.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),ht=R.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function gt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function _t(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!T.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(T.test(r.text))return{from:t.from,to:r.to}}return null}function vt(e,t){let n=[],r=N(e),i=_t(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(pt.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=ft.exec(r.text),a=i?i[1].length:2,o=R.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=gt(r.text),a=R.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(mt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(n)}var yt=class{decorations;constructor(e){this.decorations=vt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=vt(e.view.state,e.view.visibleRanges))}},bt=A.fromClass(yt,{decorations:e=>e.decorations});function xt(){return[bt,dt]}var St=t(),Ct=P.define();function wt(e,t,n){let i=k(e.state.doc)[t.index];i&&r(n,()=>{e.dispatch({selection:I.cursor(i.from),effects:z.scrollIntoView(i.from,{y:`start`})}),e.focus()})}function Tt(e,t,n,i){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);r(i,()=>{e.dispatch({selection:I.cursor(o),effects:z.scrollIntoView(o,{y:`center`})}),e.focus()})})}function Et(e,t,n){let i=e.state.doc,a=Math.min(Math.max(t.line,1),i.lines),o=i.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);r(n,()=>{e.dispatch({selection:I.cursor(s),effects:z.scrollIntoView(s,{y:`start`})}),e.focus()})}function Dt(e){let t=(0,Re.c)(50),{docName:r,ytext:c,provider:d,placeholder:p,isSourceModeActive:m}=e,h=(0,Q.useRef)(null),g=(0,Q.useRef)(null),[_,ee]=(0,Q.useState)(null);if(_)throw _;let{resolvedTheme:y}=v(),{merged:b}=oe(),x=(0,Q.useRef)(m),S=b?.editor?.wordWrap??!0,{data:C}=Oe(r),w;t[0]!==C?.effective||t[1]!==b?(w=C?.effective??(b?.contentRules?ae(b.contentRules):ie),t[0]=C?.effective,t[1]=b,t[2]=w):w=t[2];let T=w,E;t[3]===T?E=t[4]:(E=JSON.stringify(T),t[3]=T,t[4]=E);let D=E,O,k;t[5]===m?(O=t[6],k=t[7]):(O=()=>{x.current=m},k=[m],t[5]=m,t[6]=O,t[7]=k),(0,Q.useEffect)(O,k);let A=(0,Q.useRef)(null),j;t[8]!==r||t[9]!==T||t[10]!==p||t[11]!==d||t[12]!==y||t[13]!==S||t[14]!==c?(j=()=>{let e=h.current;if(!e)return;let t=d.configuration.name??``,m,_=kt;try{m=n({docName:t,container:e,sizeStats:{viewCount:0,bytes:c.length},factory:e=>{let n=null,l=s({ydoc:d.document,ytext:c,docName:t}),u=new M,f=new M,m=new M,h=new M,g=new z({state:ye.create({doc:c.toString(),extensions:[rt,Ge,Me({scrollToMatch:e=>o(t)?z.scrollIntoView(e,{y:`start`}):Ct.of(null)}),_e.of([be]),Le(c,d.awareness),_e.of(Ie),...ne({themeCompartment:u,resolvedTheme:y,ydoc:d.document,wordWrapCompartment:f,wordWrap:S,currentDocName:t}),xt(),Ve(t),ue(),h.of(et(T,r)),$e(r),l,z.updateListener.of(e=>{i(e)&&a(t)}),z.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,me(t,`source`,de(e.view)),De(t,`source`,Ee(e.view,t))},120))}),m.of(ve(p??``)),z.theme({"&":{height:`100%`}}),z.scrollMargins.of(Ot)]}),parent:e});me(t,`source`,de(g)),De(t,`source`,Ee(g,t));let v=g.contentDOM;return v.addEventListener(`keydown`,_),v.addEventListener(`paste`,_),v.addEventListener(`drop`,_),v.addEventListener(`cut`,_),{view:g,ydoc:d.document,ytext:c,provider:d,themeCompartment:u,wordWrapCompartment:f,placeholderCompartment:m,lintCompartment:h}}}),A.current=m,g.current=m.view,f(r,m.view),he()&&m.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),A.current=null,g.current=null,ee(t instanceof Error?t:Error(String(t)))}return()=>{let e=A.current;e&&(l(e),u(r,e.view)),A.current=null,g.current=null}},t[8]=r,t[9]=T,t[10]=p,t[11]=d,t[12]=y,t[13]=S,t[14]=c,t[15]=j):j=t[15];let N;t[16]!==d||t[17]!==c?(N=[c,d],t[16]=d,t[17]=c,t[18]=N):N=t[18],(0,Q.useEffect)(j,N);let P,F;t[19]===r?(P=t[20],F=t[21]):(P=()=>{},F=[r],t[19]=r,t[20]=P,t[21]=F),(0,Q.useEffect)(P,F);let I,L;t[22]===y?(I=t[23],L=t[24]):(L=()=>{let e=A.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(y===`dark`?te:re)})},I=[y],t[22]=y,t[23]=I,t[24]=L),(0,Q.useEffect)(L,I);let R,B;t[25]===S?(R=t[26],B=t[27]):(R=()=>{let e=A.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(S?z.lineWrapping:[])})},B=[S],t[25]=S,t[26]=R,t[27]=B),(0,Q.useEffect)(R,B);let V,H;t[28]===p?(V=t[29],H=t[30]):(V=()=>{let e=A.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(p??``))})},H=[p],t[28]=p,t[29]=V,t[30]=H),(0,Q.useEffect)(V,H);let U;t[31]!==r||t[32]!==T?(U=()=>{let e=A.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(et(T,r))})},t[31]=r,t[32]=T,t[33]=U):U=t[33];let W;t[34]===D?W=t[35]:(W=[D],t[34]=D,t[35]=W),(0,Q.useEffect)(U,W);let G,K;t[36]!==r||t[37]!==m?(G=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||t.mode!==`source`||!m)return;let n=g.current;n&&(wt(n,t,r),ce(r))};return window.addEventListener(ge,e),()=>window.removeEventListener(ge,e)},K=[r,m],t[36]=r,t[37]=m,t[38]=G,t[39]=K):(G=t[38],K=t[39]),(0,Q.useEffect)(G,K);let q,J;t[40]!==r||t[41]!==m?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||!m)return;let n=g.current;n&&(Et(n,t,r),ce(r))};return window.addEventListener(pe,e),()=>window.removeEventListener(pe,e)},J=[r,m],t[40]=r,t[41]=m,t[42]=q,t[43]=J):(q=t[42],J=t[43]),(0,Q.useEffect)(q,J);let Y,X;t[44]!==r||t[45]!==m||t[46]!==d?(Y=()=>{if(!m)return;let e=g.current;if(!e)return;let t=se(r);if(!t)return;if(t.kind!==`selection-offset`){le(r),t.kind===`outline`?wt(e,t.detail,r):t.kind===`lint`?Et(e,t.detail,r):t.kind===`raw-mdx`&&Tt(e,t.detail,()=>x.current,r);return}let n=!1,i=null;return queueMicrotask(()=>{if(n)return;let t=se(r);t?.kind===`selection-offset`&&(i=fe({view:e,docName:r,navigation:t,ydoc:d.document,transition:{from:`wysiwyg`,to:`source`}}),i&&le(r))}),()=>{n=!0,i?.cancel(`mode-flip`)}},X=[r,m,d],t[44]=r,t[45]=m,t[46]=d,t[47]=Y,t[48]=X):(Y=t[47],X=t[48]),(0,Q.useEffect)(Y,X);let Z;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,St.jsx)(`div`,{ref:h,className:`source-editor h-full pb-3`}),t[49]=Z):Z=t[49],Z}function Ot(){return{top:S()}}function kt(){return b()}export{Dt as SourceEditor,Tt as applyRawMdxNavigation};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./config-provider-BkCITdUN.js";import{t as o}from"./use-installed-clis-vg6izNL9.js";import{t as s}from"./use-live-xterm-theme-C2sLeh-e.js";import{SessionsHost as c}from"./SessionsHost-vghNnZ3V.js";var l=i(),u=e(n(),1),d=t();function f(e){let t=(0,l.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,d.jsx)(p,{bridge:n}),t[0]=n,t[1]=i);let o;return t[2]!==r||t[3]!==i?(o=(0,d.jsx)(a,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4],o}function p(e){let t=(0,l.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),a=s(i),f=o(),[p,g]=(0,u.useState)(null),_;t[0]===a.background?_=t[1]:(_=(0,d.jsx)(`div`,{ref:g,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:a.background}}),t[0]=a.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==f?(v=(0,d.jsx)(c,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:h,installedClis:f,container:p,isShowing:!0,onRequestEditorFocus:m}),t[2]=n,t[3]=p,t[4]=f,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,d.jsxs)(d.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function m(){}function h(e){e||window.close()}export{f as TerminalWindowApp};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./config-provider-CRIf4i0O.js";import{t as o}from"./use-installed-clis-vg6izNL9.js";import{t as s}from"./use-live-xterm-theme-C2sLeh-e.js";import{SessionsHost as c}from"./SessionsHost-B4ARZMWM.js";var l=i(),u=e(n(),1),d=t();function f(e){let t=(0,l.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,d.jsx)(p,{bridge:n}),t[0]=n,t[1]=i);let o;return t[2]!==r||t[3]!==i?(o=(0,d.jsx)(a,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4],o}function p(e){let t=(0,l.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),a=s(i),f=o(),[p,g]=(0,u.useState)(null),_;t[0]===a.background?_=t[1]:(_=(0,d.jsx)(`div`,{ref:g,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:a.background}}),t[0]=a.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==f?(v=(0,d.jsx)(c,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:h,installedClis:f,container:p,isShowing:!0,onRequestEditorFocus:m}),t[2]=n,t[3]=p,t[4]=f,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,d.jsxs)(d.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function m(){}function h(e){e||window.close()}export{f as TerminalWindowApp};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o}from"./CodeMirrorPropInput-wxzi2HMF.js";import{ls as s,pr as c,xs as l}from"./dist-DSS3ixln2.js";import{g as u}from"./config-provider-BkCITdUN.js";import{Dt as d,P as f,Z as p,kt as m}from"./dist-EbTHn-HD.js";import{t as h}from"./cm-theme-CqnwWjn0.js";import{t as g}from"./dist-O5qpSCnc2.js";import{t as _}from"./text-viewer-languages-BtwF8E4F.js";import{t as v}from"./src-BhVr0kka.js";var y=a(),b=e(n(),1),x=t(),S=h({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=h({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(19),{docName:n,provider:a}=e,{_:h}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D;t[0]===a.document?D=t[1]:(D=a.document.getText(`source`),t[0]=a.document,t[1]=D);let O=D,k;t[2]===O?k=t[3]:(k=()=>new u(O),t[2]=O,t[3]=k);let[A]=(0,b.useState)(k),j;t[4]!==n||t[5]!==a.awareness||t[6]!==E||t[7]!==A||t[8]!==O?(j=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new d,i=new d,u=(s[c(n)]??l(c(n)))!==null&&c(n)!==``,h=new p({state:m.create({doc:O.toString(),extensions:[g,v(O,a.awareness,{undoManager:A}),r.of([]),f(o),i.of(u?[]:p.lineWrapping),p.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=c(n)||null;return b&&_(b,s[b]??l(b)).then(e=>{y||!e||h.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,h.destroy()}},t[4]=n,t[5]=a.awareness,t[6]=E,t[7]=A,t[8]=O,t[9]=j):j=t[9];let M;t[10]!==n||t[11]!==a||t[12]!==E||t[13]!==A||t[14]!==O?(M=[O,a,E,n,A],t[10]=n,t[11]=a,t[12]=E,t[13]=A,t[14]=O,t[15]=M):M=t[15],(0,b.useEffect)(j,M);let N=h({id:`xAlHfe`,values:{basename:w}}),P;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[16]=P):P=t[16];let F;return t[17]===N?F=t[18]:(F=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":N,"data-text-doc-editor":``,children:P}),t[17]=N,t[18]=F),F}export{w as TextDocEditor};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o}from"./CodeMirrorPropInput-B2m6_Glf.js";import{ls as s,pr as c,xs as l}from"./dist-DSS3ixln2.js";import{g as u}from"./config-provider-CRIf4i0O.js";import{Dt as d,P as f,Z as p,kt as m}from"./dist-EbTHn-HD.js";import{t as h}from"./cm-theme-CqnwWjn0.js";import{t as g}from"./dist-O5qpSCnc2.js";import{t as _}from"./text-viewer-languages-BtwF8E4F.js";import{t as v}from"./src-Bhg0wW5z.js";var y=a(),b=e(n(),1),x=t(),S=h({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=h({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(19),{docName:n,provider:a}=e,{_:h}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D;t[0]===a.document?D=t[1]:(D=a.document.getText(`source`),t[0]=a.document,t[1]=D);let O=D,k;t[2]===O?k=t[3]:(k=()=>new u(O),t[2]=O,t[3]=k);let[A]=(0,b.useState)(k),j;t[4]!==n||t[5]!==a.awareness||t[6]!==E||t[7]!==A||t[8]!==O?(j=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new d,i=new d,u=(s[c(n)]??l(c(n)))!==null&&c(n)!==``,h=new p({state:m.create({doc:O.toString(),extensions:[g,v(O,a.awareness,{undoManager:A}),r.of([]),f(o),i.of(u?[]:p.lineWrapping),p.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=c(n)||null;return b&&_(b,s[b]??l(b)).then(e=>{y||!e||h.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,h.destroy()}},t[4]=n,t[5]=a.awareness,t[6]=E,t[7]=A,t[8]=O,t[9]=j):j=t[9];let M;t[10]!==n||t[11]!==a||t[12]!==E||t[13]!==A||t[14]!==O?(M=[O,a,E,n,A],t[10]=n,t[11]=a,t[12]=E,t[13]=A,t[14]=O,t[15]=M):M=t[15],(0,b.useEffect)(j,M);let N=h({id:`xAlHfe`,values:{basename:w}}),P;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[16]=P):P=t[16];let F;return t[17]===N?F=t[18]:(F=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":N,"data-text-doc-editor":``,children:P}),t[17]=N,t[18]=F),F}export{w as TextDocEditor};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./code-highlighter-impl-CqBvFNiv.js","./lib-B3XVxNhx.js","./html-void-elements-XfxYgU9i.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{$n as r,Dr as i,Gr as a,Zn as o,cr as s,er as c,i as l,qn as u,tr as d}from"./DocumentContext-Cvt0LP7f.js";import{t as f}from"./react-f2sANaYj.js";import{n as p,r as m}from"./dist-Nvb76hAm.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{i as g,o as _}from"./local-menu-action-bus-BuSRFm5g.js";import{t as v}from"./utils-CPqDy6Hr.js";import{t as y}from"./mascot-outline-CtS592mc.js";import{t as b}from"./button-CA0dewJJ.js";import{i as x,n as S,t as C}from"./tooltip-DPvMEqsq.js";import{c as w,i as T,t as E}from"./dialog-BH80AfFt.js";import{Tt as D}from"./CodeMirrorPropInput-wxzi2HMF.js";import{c as O,d as k,f as A,l as j,m as M,n as N,o as P,p as F,r as ee,t as I}from"./dropdown-menu-BpLbh79a.js";import{a as te,c as ne,d as re,f as L,i as ie,l as ae,n as oe,o as R,p as se,r as ce,s as le,t as z,u as ue,v as B}from"./progress-BeVvrxJn.js";import{t as de}from"./switch-BeP1gMN6.js";import{Zr as fe,ft as pe}from"./dist-DSS3ixln2.js";import{n as me}from"./dist-CuH7ikCn.js";import{t as V}from"./dist-BIGNzOeF2.js";import{i as he,t as H}from"./history-BteF85_l.js";import{n as ge}from"./use-workspace-DriKk3ci.js";import{t as U}from"./createLucideIcon-CAkY8Blx.js";import{n as W,s as _e,u as ve}from"./Mermaid-NYQ6RsUB.js";import{t as ye}from"./RegisteredAgentIcon-Fkz5hv6G.js";import{t as G}from"./check-Bzwwm-o4.js";import{t as be}from"./chevron-down-xENV92Te.js";import{t as xe}from"./chevron-right-BVvjaUfh.js";import{o as K,r as Se,s as Ce}from"./prop-types-nOgQFiCi.js";import{n as we,t as q}from"./terminal-CFd7qrv_.js";import{t as Te}from"./list-plus-1_iMFVqs.js";import{t as Ee}from"./spinner-DmibE6UV.js";import{c as De,n as Oe,o as ke,s as Ae,t as je}from"./comment-chips-DKGNPHft.js";import{t as Me}from"./rotate-ccw-Dh7y6tzD.js";import{t as Ne}from"./square-pen-Blyr7NAu.js";import{t as Pe}from"./trash-2-BVoWHmfV.js";import{t as Fe}from"./wrench-JX3g_hHJ.js";import{t as Ie}from"./x-wQUDJS55.js";import{f as Le,s as Re}from"./doc-paths-oMq41Y7d.js";import{t as ze}from"./external-link-DGqXfQJy.js";import{t as Be}from"./badge-DGD9B_-e.js";import{t as Ve}from"./skeleton-DIxLroLR.js";import{t as He}from"./textarea-BtqZ3yY1.js";import{n as Ue}from"./agent-presence-C_iH_p3q.js";import{i as We,n as Ge}from"./chunk-BO2N2NFS-BVKS5mdX.js";import{n as Ke}from"./libesm-B7m5uxaw.js";import{a as qe,d as Je,f as Ye,m as Xe,n as Ze,p as Qe,r as $e,s as et}from"./thread-client-o-xHAmeK.js";import{n as tt}from"./thread-draft-staging-D-3dp2ov.js";var nt=U(`folder-input`,[[`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`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),rt=U(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),it=U(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),at=U(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),J=h(),ot=new RegExp([`bypass`,`acceptedits`,`fullaccess`,`autoedit`,`yolo`,`danger`,`fullauto`,`autoaccept`,`autoapprove`,`autorun`,`skippermission`,`noconfirm`,`noprompt`,`unrestricted`,`allowall`].join(`|`)),st=new Set([`auto`]);function ct(e){return e.toLowerCase().replace(/[^a-z]/g,``)}function lt(e){let t=ct(e.id),n=ct(e.name??``);return st.has(t)||st.has(n)?!0:ot.test(t)||ot.test(n)}var ut={"claude-acp":`asks`,"codex-acp":`self-managed`,cursor:`self-managed`,"pi-acp":`autonomous`};function dt(e,t,n){let r=n??(t==null?null:t.availableModes.find(e=>e.id===t.currentModeId)??null),i=ut[e];return i===void 0?t!=null&&t.availableModes.length>0?`self-managed`:`unknown`:i===`asks`&&r!==null&&lt(r)?`self-managed`:i}var Y=e(f(),1),X=n();function ft({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=pt(mt(r,i),t);if(!n)return Y.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!Y.isValidElement(n))return null;let o=n.props,s={...pt(a,o),ref:_t(a.ref,o.ref)};return Y.cloneElement(n,s)}function pt(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];n===`className`?t[n]=[i,r].filter(Boolean).join(` `):n===`style`?t[n]={...i,...r}:n===`ref`?t[n]=_t(i,r):gt(n)&&typeof i==`function`&&typeof r==`function`?t[n]=ht(r,i):t[n]=r}}return t}function mt(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function ht(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function gt(e){return/^on[A-Z]/.test(e)}function _t(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var vt=8,yt=64,bt=0,xt=.5,St=180,Ct=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),wt={start:!1,end:!1},Tt={currentAnchorId:null,visibleMessageIds:[]};function Et({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return wt;let i=Rt({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function Dt({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Tt;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of Ot(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+xt&&(u=e)}return l.length===0&&u===null?Tt:{currentAnchorId:u,visibleMessageIds:l}}function Ot(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function kt(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function At(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function jt(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Mt(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function Nt({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of Ot(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Pt({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Ft(t,i),o=t.getBoundingClientRect().height,s=Vt(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Ft(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function It(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function Lt({content:e,scrollTop:t,spacer:n,viewport:r}){let i=Rt({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function Rt({content:e,spacer:t,viewport:n}){let r=Ot(e,t),i=Bt(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function zt(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Bt(e){let t=window.getComputedStyle(e);return{end:Ut(t.paddingBlockEnd||t.paddingBottom),start:Ut(t.paddingBlockStart||t.paddingTop)}}function Vt(e){let t=e?.parentElement;return t?Bt(t):{end:0,start:0}}function Ht(e){if(!e)return 0;let t=window.getComputedStyle(e);return Ut(t.rowGap===`normal`?t.gap:t.rowGap)}function Ut(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Wt({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,defaultScrollPositionAppliedRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=Y.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},St))},[t]),S=Y.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=Y.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);if(Math.abs(a.scrollTop-o)<=xt){a.scrollTop=o,t();return}i&&x(!0),a.scrollTo({top:o,behavior:r}),n()},[t,n,x]),w=Y.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=Y.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(zt(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=Y.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=b.current;if(!s||!l||!s.contains(e))return!1;let u=Pt({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:l});return S(Lt({content:s,scrollTop:u,spacer:y.current,viewport:l})),m.current={element:e,viewportTop:It(e,l)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=Y.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=Y.useCallback((e,t)=>{let n=d.current.get(e);return n?(l.current=!0,E(n,t)?(p.current=null,!0):(p.current={messageId:e,options:t},!0)):u.current===0?(p.current={messageId:e,options:t},l.current=!0,!0):!1},[E]);return{flushPendingScrollToMessage:Y.useCallback(()=>{let e=p.current;if(!e)return!1;let t=d.current.get(e.messageId);return!t||!E(t,e.options)?!1:(p.current=null,l.current=!0,!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function Gt(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function Kt(e,t){return Gt(e,t)}function qt(){return Gt(Tt,Yt)}function Jt(e,t){return e.start===t.start&&e.end===t.end}function Yt(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function Xt({autoScroll:e,scrollEdgeThreshold:t,scrollMargin:n,scrollPreviousItemPeek:r}){let i=Y.useRef(e),a=Y.useRef(!1),o=Y.useRef(null),s=Y.useRef(!1),c=Y.useRef(t),l=Y.useRef(0),u=Y.useRef(null),d=Y.useRef(0),f=Y.useRef(e?`following-bottom`:`free-scrolling`),p=Y.useRef(new Map),m=Y.useRef(null),h=Y.useRef(null),g=Y.useRef(null),_=Y.useRef(r),v=Y.useRef(!0),y=Y.useRef(null),b=Y.useRef(n),x=Y.useRef(null),S=Y.useRef(0),C=Y.useRef(0),w=Y.useRef(null),T=Y.useRef(null),E=Y.useRef(null),D=Y.useRef(null),O=Y.useRef(null),k=Y.useRef(null),A=Y.useRef(null),j=Y.useRef(null),M=Y.useRef(new Set),N=Y.useRef(new WeakSet);return E.current===null&&(E.current=Kt(wt,Jt)),j.current===null&&(j.current=qt()),i.current=e,c.current=t,b.current=n,_.current=r,{autoScrollRef:i,autoscrollingRef:a,autoscrollingTimeoutRef:D,streamingTurnRef:g,contentRef:o,defaultScrollPositionAppliedRef:s,firstItemRef:u,itemCountRef:l,lastScrollTopRef:d,messageElementsRef:p,modeRef:f,pendingScrollFrameRef:x,pendingScrollToMessageRef:m,prependRestoreRef:h,preserveScrollOnPrependRef:v,rootRef:y,scrollEdgeThresholdRef:c,scrollMarginRef:b,scrollPreviousItemPeekRef:_,spacerGapRef:S,spacerHeightRef:C,spacerRef:w,stateFrameRef:T,stateStore:E.current,viewportRef:O,visibilityFrameRef:k,visibilityObserverRef:A,visibilityStore:j.current,visibleMessageIdsRef:M,handledScrollAnchorsRef:N}}function Zt(e,t){return Y.useCallback(n=>{e.current=n,n&&t()},[e,t])}function Qt({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=vt,scrollPreviousItemPeek:r=yt,scrollMargin:i=bt}){let a=Xt({autoScroll:e,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,rootRef:x,scrollEdgeThresholdRef:S,scrollMarginRef:C,scrollPreviousItemPeekRef:w,spacerGapRef:T,spacerHeightRef:E,spacerRef:D,stateFrameRef:O,stateStore:k,viewportRef:A,visibilityFrameRef:j,visibilityObserverRef:M,visibilityStore:N,visibleMessageIdsRef:P,handledScrollAnchorsRef:F}=a,ee=Y.useRef(t);ee.current!==t&&(ee.current=t,d.current=!1);let I=Y.useCallback(e=>{let t=x.current,n=A.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),te=Y.useCallback(e=>{let t=A.current?.scrollTop??0,n=t<m.current-xt;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),ne=Y.useCallback(()=>{let e=Et({content:u.current,scrollEdgeThreshold:S.current,spacer:D.current,viewport:A.current});te(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;I(t),k.setSnapshot(t)},[te,k,I]),re=Y.useCallback(()=>{O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,ne()}))},[ne]),L=Y.useCallback(()=>{N.hasListeners()&&j.current===null&&(j.current=window.requestAnimationFrame(()=>{j.current=null,N.hasListeners()&&N.setSnapshot(Dt({content:u.current,scrollMargin:C.current,scrollPreviousItemPeek:w.current,spacer:D.current,viewport:A.current,visibleMessageIds:P.current}))}))},[N]),{flushPendingScrollToMessage:ie,reanchorToAnchoredMessage:ae,scrollToElement:oe,scrollToEnd:R,scrollToMessage:se,scrollToStart:ce}=Wt({refs:a,commitScrollState:ne,scheduleStateCommit:re,scheduleVisibilitySync:L}),le=Y.useCallback(()=>{let e=y.current,t=A.current;if(!e||!t||!e.element.isConnected)return!1;let n=It(e.element,t)-e.viewportTop;return Math.abs(n)<=xt?!1:(t.scrollTop+=n,e.viewportTop=It(e.element,t),re(),L(),!0)},[re,L]),z=Y.useCallback(()=>{let e=u.current,t=A.current;if(!e||!t){y.current=null;return}let n=Nt({content:e,spacer:D.current,viewport:t});y.current=n?{element:n,viewportTop:It(n,t)}:null},[]),ue=Y.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,ie()&&z()}))},[z,ie]),B=Y.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=A.current,r=t&&n?Mt(Ot(t,D.current)):null;if(!t||!n||!r)e=R({behavior:`auto`});else{let i=Ft(r,n);e=Rt({content:t,spacer:D.current,viewport:n})-i<=n.clientHeight?R({behavior:`auto`}):oe(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?R({behavior:`auto`}):ce({behavior:`auto`});return e?(d.current=!0,!0):!1},[t,oe,R,ce]),de=Y.useCallback(()=>{let e=u.current;if(!e)return;let t=Ot(e,D.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(ie())return;if(n===0){if(B()||t.length>0&&s.current&&R({behavior:`auto`}))return;ne(),L();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0){le();return}if(t.length>n){let e=kt(t,n);if(e){if(s.current&&g.current===`following-bottom`&&jt(t,n)){R({behavior:`auto`});return}oe(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}if(t.length===n){let e=At(t,F.current);if(e){oe(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}g.current===`following-bottom`&&s.current?R({behavior:`auto`}):(ne(),L())})(),z()},[B,z,ne,ie,le,L,oe,R]),fe=Y.useCallback(()=>{if(g.current===`following-bottom`&&s.current){R({behavior:`auto`});return}let e=E.current;if(ae()){s.current&&e>0&&E.current===0&&R({behavior:`auto`});return}re(),L()},[ae,re,L,R]),pe=Y.useCallback(()=>{let e=A.current;if(!(!e||!N.hasListeners())){if(typeof IntersectionObserver>`u`){L();return}M.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?P.current.add(e):P.current.delete(e))}L()},{root:e,rootMargin:`${-(C.current+w.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{M.current?.observe(e)}),L()}},[L,N]),me=Y.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),M.current?.disconnect(),M.current=null,P.current.clear(),N.setSnapshot(Tt)},[N]),V=Y.useCallback((e,t,n)=>{if(t){h.current.set(e,t),M.current?.observe(t),L(),v.current?.messageId===e&&ue();return}n&&h.current.get(e)===n&&(h.current.delete(e),P.current.delete(e),M.current?.unobserve(n),L())},[ue,L]),he=Y.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),H=Y.useCallback(()=>I(k.getSnapshot()),[k,I]),ge=Zt(x,H),U=Zt(A,H),W=Y.useCallback(e=>{u.current=e},[]),_e=Y.useCallback(e=>{D.current=e,T.current=Ht(e?.parentElement??null)},[]),ve=Y.useCallback(()=>{ne(),L(),z()},[z,ne,L]),ye=Y.useMemo(()=>({handleContentChange:de,handleResize:fe,observeVisibility:pe,preserveScrollOnPrependRef:b,scrollToEnd:R,scrollToMessage:se,scrollToStart:ce,setContentElement:W,setRootElement:ge,setSpacerElement:_e,setViewportElement:U,stateStore:k,syncAfterScroll:ve,unobserveVisibility:me,userScrollIntent:he,viewportRef:A,visibilityStore:N}),[de,fe,pe,R,se,ce,W,ge,_e,U,k,ve,me,he,N]);return Y.useLayoutEffect(()=>{B()},[B]),Y.useEffect(()=>()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),M.current?.disconnect(),M.current=null},[]),Y.useLayoutEffect(()=>{if(e&&g.current===`following-bottom`&&p.current>0){R({behavior:`auto`});return}ne()},[e,ne,R]),{context:ye,registerMessage:V}}function $t(e){let t=Y.useRef(e);return t.current=e,t}var en=Y.createContext(null),tn=Y.createContext(null);function nn(){let e=Y.useContext(en);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function rn(){let e=Y.useContext(tn);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function an(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=nn();return Y.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function on({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=Qt({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,X.jsx)(en.Provider,{value:o,children:(0,X.jsx)(tn.Provider,{value:s,children:t})})}function sn({children:e,...t}){let{setRootElement:n}=nn();return(0,X.jsx)(`div`,{ref:n,...t,children:e})}function cn({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=nn();f.current=o;let _=Y.useCallback(e=>{p(e),_t(s)?.(e)},[s,p]);function v(e){m(),r?.(e)}function y(e){h(),a?.(e)}function b(e){h(),i?.(e)}function x(e){Ct.has(e.key)&&h(),n?.(e)}return Y.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,X.jsx)(`div`,{ref:_,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:x,onScroll:v,onTouchMove:b,onWheel:y,...u,children:t})}function ln({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=nn(),u=Y.useRef(null),d=Y.useCallback(e=>{u.current=e,c(e),_t(n)?.(e)},[n,c]);return Y.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),Y.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,X.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,X.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function un({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=rn(),a=Y.useRef(null);return(0,X.jsx)(`div`,{ref:Y.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),_t(t)?.(n)},[e,t,i]),"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function dn({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=nn(),d=$t(r),f=Y.useCallback(e=>u.subscribe(e),[u]),p=Y.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=Y.useSyncExternalStore(f,p,p),h=Y.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return ft({defaultTagName:`button`,props:pt({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,X.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var fn={Provider:on,Root:sn,Viewport:cn,Content:ln,Item:un,Button:dn};function pn(e){let t=(0,J.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(fn.Provider,{...e}),t[0]=e,t[1]=n),n}function mn(e){let t=(0,J.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(fn.Root,{"data-slot":`message-scroller`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hn(e){let t=(0,J.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`size-full min-h-0 min-w-0 scrollbar-thin overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(fn.Viewport,{"data-slot":`message-scroller-viewport`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gn(e){let t=(0,J.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`flex h-max min-h-full flex-col gap-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(fn.Content,{"data-slot":`message-scroller-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _n(e){let t=(0,J.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scrollAnchor:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?!1:i,o;t[4]===n?o=t[5]:(o=v(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,X.jsx)(fn.Item,{"data-slot":`message-scroller-item`,scrollAnchor:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function vn(e){let t=(0,J.c)(25),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({direction:o,className:r,children:n,render:a,variant:s,size:c,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`end`:o,u=s===void 0?`secondary`:s,d=c===void 0?`icon-sm`:c,f;t[8]===r?f=t[9]:(f=v(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,r),t[8]=r,t[9]=f);let m;t[10]!==a||t[11]!==d||t[12]!==u?(m=a??(0,X.jsx)(b,{variant:u,size:d}),t[10]=a,t[11]=d,t[12]=u,t[13]=m):m=t[13];let h;t[14]!==n||t[15]!==l?(h=n??(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ve,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`sr-only`,children:l===`end`?(0,X.jsx)(p,{id:`EQXPXf`}):(0,X.jsx)(p,{id:`b1FDss`})})]}),t[14]=n,t[15]=l,t[16]=h):h=t[16];let g;return t[17]!==l||t[18]!==i||t[19]!==d||t[20]!==f||t[21]!==m||t[22]!==h||t[23]!==u?(g=(0,X.jsx)(fn.Button,{"data-slot":`message-scroller-button`,"data-direction":l,"data-variant":u,"data-size":d,direction:l,className:f,render:m,...i,children:h}),t[17]=l,t[18]=i,t[19]=d,t[20]=f,t[21]=m,t[22]=h,t[23]=u,t[24]=g):g=t[24],g}var yn=new Map,bn=0;function xn(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Sn(){let e=xn();for(let[t,n]of yn)t((e-n)/1e3);if(yn.size===0){bn=0;return}bn=requestAnimationFrame(Sn)}function Cn(e){return yn.set(e,xn()),bn===0&&typeof requestAnimationFrame==`function`&&(bn=requestAnimationFrame(Sn)),()=>{yn.delete(e),yn.size===0&&bn!==0&&(cancelAnimationFrame(bn),bn=0)}}var Z=40,wn=15,Q=15,$=12.4,Tn={blobby:0,triangle:1,square:2,sparkle:3,pentagon:4,hexagon:5,dot:6,star5:7,clover:8,star6:9,scallop:10,comma:11,diamond:12,cloud:13},En=`M15.34 2.91C15.96 2.77 16.69 2.65 17.33 2.63C17.97 2.62 18.72 2.71 19.36 2.84C20.00 2.97 20.79 3.10 21.33 3.44C21.88 3.79 22.38 4.46 22.75 5.01C23.12 5.56 23.42 6.30 23.66 6.89C23.90 7.49 24.06 8.18 24.26 8.73C24.45 9.28 24.66 9.84 24.89 10.34C25.12 10.84 25.39 11.36 25.68 11.85C25.97 12.34 26.46 12.87 26.71 13.41C26.96 13.94 27.12 14.61 27.26 15.21C27.39 15.80 27.54 16.52 27.55 17.14C27.56 17.76 27.43 18.47 27.30 19.09C27.16 19.71 26.99 20.43 26.72 21.01C26.46 21.58 26.05 22.20 25.64 22.69C25.22 23.17 24.65 23.63 24.15 24.02C23.66 24.41 23.09 24.82 22.55 25.14C22.02 25.45 21.39 25.74 20.84 25.99C20.28 26.25 19.65 26.52 19.08 26.70C18.50 26.89 17.83 27.05 17.23 27.15C16.63 27.26 15.95 27.34 15.34 27.37C14.73 27.39 14.03 27.40 13.42 27.33C12.81 27.26 12.12 27.10 11.54 26.92C10.95 26.73 10.30 26.47 9.75 26.18C9.20 25.90 8.62 25.51 8.11 25.15C7.61 24.80 7.06 24.37 6.60 23.94C6.15 23.52 5.68 23.00 5.28 22.52C4.89 22.03 4.47 21.45 4.13 20.92C3.79 20.38 3.41 19.75 3.16 19.16C2.91 18.57 2.68 17.86 2.56 17.23C2.45 16.60 2.42 15.85 2.45 15.21C2.48 14.56 2.60 13.83 2.76 13.22C2.93 12.60 3.18 11.91 3.47 11.35C3.77 10.80 4.24 10.23 4.63 9.75C5.01 9.27 5.45 8.74 5.89 8.34C6.34 7.95 6.93 7.61 7.40 7.27C7.88 6.94 8.38 6.57 8.83 6.25C9.29 5.93 9.79 5.56 10.27 5.25C10.75 4.95 11.29 4.61 11.81 4.33C12.32 4.05 12.92 3.74 13.49 3.52C14.05 3.29 14.73 3.05 15.34 2.91Z`,Dn=2.26,On=`M76.4805 11.041C99.1124 7.04848 118.186 8.33731 134.31 14.4102C150.369 20.4588 164.177 31.5065 175.929 48.1846L176.446 48.9199C187.179 64.5695 195.653 90.2797 191.323 112.539C186.344 138.13 169.219 160.474 150.105 178.107C131.113 195.629 111.037 207.691 101.728 212.842C98.3779 214.693 93.3915 217.316 88.0508 217.316C85.74 217.316 83.6583 216.814 81.7607 215.855L81.3838 215.658C75.1451 212.251 73.9381 205.91 73.376 198.68L73.2705 197.222C72.953 192.5 72.5095 188.039 71.1416 184.247C69.5395 179.806 66.852 176.673 63.1406 174.227L63.1377 174.225C41.2846 159.832 21.8495 144.226 13.3828 121.439L13.3818 121.438L13.0146 120.427C5.46004 99.1404 7.95139 74.5467 20.4404 52.7568L20.4414 52.7549C33.2945 30.3176 54.4303 14.925 76.4785 11.041H76.4805Z`;function kn(e){let t=t=>{let n=e[(t-1+Z)%Z],r=e[(t+1)%Z];return[(r[0]-n[0])*.16,(r[1]-n[1])*.16]},n=`M${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let r=0;r<Z;r++){let i=e[r],a=e[(r+1)%Z],o=t(r),s=t((r+1)%Z);n+=`C${(i[0]+o[0]).toFixed(2)} ${(i[1]+o[1]).toFixed(2)} ${(a[0]-s[0]).toFixed(2)} ${(a[1]-s[1]).toFixed(2)} ${a[0].toFixed(2)} ${a[1].toFixed(2)}`}return`${n}Z`}function An(e,t){let n=e.map(e=>e[0]),r=e.map(e=>e[1]),i=Math.min(...n),a=Math.max(...n),o=Math.min(...r),s=Math.max(...r),c=t*2/Math.max(a-i,s-o);return e.map(e=>[wn+(e[0]-(i+a)/2)*c,Q+(e[1]-(o+s)/2)*c])}function jn(e,t,n){let r=e;for(let e=0;e<t;e++){let e=r;r=e.map((t,r)=>{let i=e[(r-1+Z)%Z],a=e[(r+1)%Z];return[t[0]*(1-n)+(i[0]+a[0])/2*n,t[1]*(1-n)+(i[1]+a[1])/2*n]})}return r}function Mn(){if(typeof document>`u`)return null;let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.style.position=`absolute`,e.style.visibility=`hidden`;let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);if(e.appendChild(t),document.body.appendChild(e),typeof t.getTotalLength!=`function`||typeof t.getPointAtLength!=`function`)return e.remove(),null;try{t.setAttribute(`d`,`M0 0L1 0`),t.getPointAtLength(0)}catch{return e.remove(),null}return t}function Nn(e){function t(t,n){e.setAttribute(`d`,t);let r=e.getTotalLength(),i=[];for(let t=0;t<n;t++){let a=e.getPointAtLength(r*t/n);i.push([a.x,a.y])}return i}function n(e){let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];t/=e.length,n/=e.length;let r=Array(Z).fill(0),i=Array(Z).fill(1/0);for(let a of e){let e=Math.atan2(a[1]-n,a[0]-t),o=Math.hypot(a[0]-t,a[1]-n),s=Math.round((e+Math.PI/2)/(2*Math.PI)*Z);s=(s%Z+Z)%Z,o>r[s]&&(r[s]=o),o<i[s]&&(i[s]=o)}return{cx:t,cy:n,hi:r,lo:i}}function r(e,t,n){return e.map((e,r)=>{let i=-Math.PI/2+r*2*Math.PI/Z;return[t+Math.cos(i)*e,n+Math.sin(i)*e]})}function i(e,i){let{cx:a,cy:o,hi:s,lo:c}=n(t(e,1080)),l=s.map((e,t)=>(e+c[t])/2),u=s.reduce((e,t,n)=>e+(t-c[n]),0)/Z,d=r(l,a,o),f=d.map(e=>e[0]),p=d.map(e=>e[1]),m=i*2/Math.max(Math.max(...f)-Math.min(...f),Math.max(...p)-Math.min(...p));return{path:kn(An(d,i)),strokeWidth:u*m}}function a(e,i){let{cx:a,cy:o,hi:s}=n(t(e,1400));return kn(An(r(s.map((e,t)=>s[t]*.86+(s[(t-1+Z)%Z]+s[(t+1)%Z])*.07),a,o),i))}function o(e,n){return kn(An(t(e,Z),n))}function s(e,n,r){return kn(jn(t(e,Z),n,r))}function c(e,n,r){return kn(t(e,Z).map(e=>[wn+(e[0]-wn)*n,Q+(e[1]-Q)*r]))}function l(e,n,r=1){return kn(t(e,Z).map((e,t)=>{let i=t*2*Math.PI/Z,a=1+r*(.035*Math.sin(i*3+n)+.025*Math.sin(i*5+n*2)+.018*Math.sin(i*2-n));return[wn+(e[0]-wn)*a,Q+(e[1]-Q)*a]}))}function u(e,t,n,r=0){let i=[];for(let n=0;n<e;n++){let a=-Math.PI/2+n*2*Math.PI/e+r;i.push([wn+Math.cos(a)*t,Q+Math.sin(a)*t])}let a=(e,t)=>{let n=t[0]-e[0],r=t[1]-e[1],i=Math.hypot(n,r);return[n/i,r/i]},o=``;for(let t=0;t<e;t++){let r=i[t],s=a(r,i[(t-1+e)%e]),c=a(r,i[(t+1)%e]),l=[r[0]+s[0]*n,r[1]+s[1]*n],u=[r[0]+c[0]*n,r[1]+c[1]*n];o+=`${t?`L`:`M`}${l[0].toFixed(2)} ${l[1].toFixed(2)}A${n} ${n} 0 0 1 ${u[0].toFixed(2)} ${u[1].toFixed(2)}`}return`${o}Z`}function d(e,n,r,i){let a=``;for(let t=0;t<e*2;t++){let i=-Math.PI/2+t*Math.PI/e,o=t%2?r:n;a+=`${t?`L`:`M`}${(wn+Math.cos(i)*o).toFixed(2)} ${(Q+Math.sin(i)*o).toFixed(2)}`}return kn(An(jn(t(`${a}Z`,Z),i,.3),n))}function f(e,n,r){let i=t=>{let n=-Math.PI/2+t*Math.PI/2;return[wn+Math.cos(n)*e,Q+Math.sin(n)*e]},a=`M${i(0)[0].toFixed(2)} ${i(0)[1].toFixed(2)}`;for(let e=0;e<4;e++){let t=-Math.PI/2+(e+.5)*Math.PI/2,r=[wn+Math.cos(t)*n,Q+Math.sin(t)*n],o=i((e+1)%4);a+=`Q${r[0].toFixed(2)} ${r[1].toFixed(2)} ${o[0].toFixed(2)} ${o[1].toFixed(2)}`}return kn(An(jn(t(`${a}Z`,Z),r,.34),e))}function p(e,t,n,r){let i=[];for(let a=0;a<Z;a++){let o=-Math.PI/2+a*2*Math.PI/Z,s=(1+Math.cos(e*(o+Math.PI/2)))/2,c=n+(t-n)*s**r;i.push([wn+Math.cos(o)*c,Q+Math.sin(o)*c])}return kn(i)}function m(e){let t=[];for(let n=0;n<Z;n++){let r=-Math.PI/2+n*2*Math.PI/Z;t.push([wn+Math.cos(r)*e,Q+Math.sin(r)*e])}return kn(t)}return{silhouette:i,hull:a,fit:o,soften:s,squeeze:c,wobble:l,poly:u,star:d,sparkle:f,lobed:p,dot:m,circle:(e,t,n)=>`M${e-n} ${t}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0`}}function Pn(){let e=Mn();if(e===null)return null;try{let t=Nn(e),n=t.silhouette(y,12.55);return{paths:[n.path,t.wobble(t.poly(3,$*1.16,$*.5,.1),1.1),t.wobble(t.poly(4,$*1.02,$*.44),2.3),t.wobble(t.sparkle($*1.24,$*.1,3),3.7),t.wobble(t.poly(5,$*1,$*.38),4.9),t.wobble(t.poly(6,$*.98,$*.34),6.2),t.wobble(t.dot($*.34),2.8),t.wobble(t.star(5,$*1.14,$*.68,6),7.4),t.wobble(t.soften(t.lobed(4,$*1.16,$*.46,.5),3,.3),8.1),t.wobble(t.star(6,$*1.2,$*.42,4),9.3),t.wobble(t.lobed(8,$*1.06,$*.74,.6),10.5),t.wobble(t.soften(t.fit(On,$*1.12),3,.22),11.7,.3),t.wobble(t.squeeze(t.poly(4,$*1.3,$*.2),.84,1),12.9),t.wobble(t.hull(t.circle(10.2,16,4.3)+t.circle(15,12,5.5)+t.circle(20,15.4,4.4)+t.circle(15,17.4,5.2),12.4),13.6)],strokeWidth:n.strokeWidth}}finally{e.ownerSVGElement?.remove()}}var Fn;function In(){return Fn===void 0&&(Fn=Pn()),Fn}var Ln=/-?\d+(?:\.\d+)?/g;function Rn(e){return{fragments:e[0].split(Ln),numbers:e.map(e=>(e.match(Ln)??[]).map(Number))}}function zn(e,t){let n=``;for(let r=0;r<t.length;r++)n+=e[r]+t[r].toFixed(2);return n+e[t.length]}function Bn(e){return e<.5?2*e*e:1-2*(1-e)**2}var Vn=.58;function Hn(e,t,n,r){let i=t-1,a=n/i,o=e%n,s=Math.max(0,Math.min(i-1,Math.floor(o/a))),c=o%a/a;return{from:s,to:s+1,t:Bn(r?Math.min(1,c/Vn):c)}}var Un=Tn,Wn=[Un.blobby,Un.triangle,Un.square,Un.sparkle,Un.comma,Un.pentagon,Un.hexagon,Un.blobby],Gn={[Un.comma]:-2.9},Kn={leftCx:10.9,rightCx:18.1,cy:16,rx:1.25,ry:1.9},qn=20,Jn=8.4;function Yn(e){let t=(0,J.c)(22),{status:n,className:r,testId:i}=e,{_:a}=m(),o=(0,Y.useRef)(null),s=(0,Y.useRef)(null),c=W(),l,u;t[0]===c?(l=t[1],u=t[2]):(l=()=>{let e=o.current;if(e===null)return;if(c){e.setAttribute(`d`,En),e.setAttribute(`stroke-width`,String(Dn)),s.current?.removeAttribute(`transform`);return}let t=In();if(t===null)return;e.setAttribute(`stroke-width`,t.strokeWidth.toFixed(2));let n=Rn(t.paths),r=NaN,i=``;return Cn(t=>{let{from:a,to:o,t:c}=Hn(t,Wn.length,Jn,!0),l=n.numbers[Wn[a]],u=n.numbers[Wn[o]],d=l.map((e,t)=>e+(u[t]-e)*c),f=zn(n.fragments,d);f!==i&&(i=f,e.setAttribute(`d`,f));let p=s.current;if(p===null)return;let m=Gn[Wn[a]]??0,h=m+((Gn[Wn[o]]??0)-m)*c;h!==r&&(r=h,p.setAttribute(`transform`,`translate(0 ${h.toFixed(2)})`))})},u=[c],t[0]=c,t[1]=l,t[2]=u),(0,Y.useEffect)(l,u);let[d,f]=(0,Y.useState)(``),p,h;t[3]===a?(p=t[4],h=t[5]):(p=()=>{f(a({id:`DCSSZt`}))},h=[a],t[3]=a,t[4]=p,t[5]=h),(0,Y.useEffect)(p,h);let g;t[6]===r?g=t[7]:(g=v(`ok-working-enter flex items-center gap-2`,r),t[6]=r,t[7]=g);let _;t[8]===d?_=t[9]:(_=(0,X.jsx)(`span`,{"aria-live":`polite`,className:`sr-only`,role:`status`,children:d}),t[8]=d,t[9]=_);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(`path`,{ref:o,d:En,fill:`none`,stroke:`currentColor`,strokeWidth:Dn,strokeLinejoin:`round`,strokeLinecap:`round`}),t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(`span`,{className:`grid shrink-0 place-items-center text-muted-foreground/80`,children:(0,X.jsx)(`svg`,{width:qn,height:qn,viewBox:`0 0 30 30`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,className:`ok-working-pop ok-working-squint block shrink-0 overflow-visible`,children:(0,X.jsxs)(`g`,{className:`ok-working-group`,children:[y,(0,X.jsxs)(`g`,{ref:s,children:[(0,X.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Kn.leftCx,cy:Kn.cy,rx:Kn.rx,ry:Kn.ry,fill:`currentColor`}),(0,X.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Kn.rightCx,cy:Kn.cy,rx:Kn.rx,ry:Kn.ry,fill:`currentColor`})]})]})})}),t[11]=b):b=t[11];let x;t[12]===n?x=t[13]:(x=(0,X.jsx)(`span`,{className:`shimmer`,children:n}),t[12]=n,t[13]=x);let S;t[14]!==n||t[15]!==x?(S=(0,X.jsx)(`span`,{className:`ok-working-status text-sm`,children:x},n),t[14]=n,t[15]=x,t[16]=S):S=t[16];let C;return t[17]!==S||t[18]!==g||t[19]!==_||t[20]!==i?(C=(0,X.jsxs)(`div`,{className:g,"data-testid":i,children:[_,b,S]}),t[17]=S,t[18]=g,t[19]=_,t[20]=i,t[21]=C):C=t[21],C}function Xn(e){let t=[];for(let n of e.options)`value`in n?t.push(n):t.push(...n.options);return t}function Zn(e){let t=Xn(e),n=t.find(t=>t.value===e.currentValue);if(n===void 0||n.value!==`default`||!n.description)return null;let r=t.find(e=>e.value!==n.value&&e.description===n.description);return r===void 0?null:V._({id:`GK5Ft_`,values:{0:r.name}})}function Qn(e,t,n){return e===`claude-acp`&&t===`effort`&&n===`default`?V._({id:`3SWNP8`}):e===`codex-acp`&&t===`collaboration_mode`&&n===`default`?V._({id:`R6ABfU`}):null}var $n=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),er=700*1024;function tr(e){if(e.kind===`unsupported-type`)return e.mimeType.startsWith(`image/`)?`Only PNG, JPEG, GIF, and WebP images are supported (got ${e.mimeType}).`:`Unsupported file type: ${e.mimeType||`unknown`}.`;if(e.kind===`outside-workspace`)return`${e.name} is outside the workspace. Move it into your project first.`;if(e.kind===`unknown-path`)return`${e.name} has no resolvable path — the agent can only read files inside the workspace.`;let t=(e.limitBytes/(1024*1024)).toFixed(1);return`File is too large (${(e.sizeBytes/(1024*1024)).toFixed(1)} MB) — max ${t} MB per attachment.`}async function nr(e){let t=await new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`FileReader failed`)),r.onload=()=>{let e=r.result;if(typeof e!=`string`){n(Error(`FileReader returned non-string result`));return}t(e)},r.readAsDataURL(e)}),n=t.indexOf(`,`);return{data:n>=0?t.slice(n+1):t,mimeType:e.type||`application/octet-stream`,name:e.name||`image`,sizeBytes:e.size}}async function rr(e){let t=e.type||``;if(!$n.has(t))return{ok:!1,error:{kind:`unsupported-type`,mimeType:t}};if(e.size>716800)return{ok:!1,error:{kind:`too-large`,sizeBytes:e.size,limitBytes:er}};let n=await nr(e);return{ok:!0,part:{kind:`image`,data:n.data,mimeType:n.mimeType,name:n.name,sizeBytes:n.sizeBytes}}}function ir(e){return or(e,e=>e.type.startsWith(`image/`))}function ar(e){return or(e,e=>e.size>0)}function or(e,t){if(e===null)return[];let n=[],r=e=>{e!==null&&t(e)&&n.push(e)},i=!1,a=e.items;if(a)for(let e=0;e<a.length;e+=1){let t=a[e];if(!t||t.kind!==`file`)continue;let n=t.getAsFile();n!==null&&(i=!0,r(n))}if(!i){let t=e.files;if(t)for(let e=0;e<t.length;e+=1)r(t[e]??null)}return n}function sr(e,t,n){let r=n===`\\`?e.toLowerCase():e,i=n===`\\`?t.toLowerCase():t,a=i.endsWith(n)?i:`${i}${n}`;if(r===i)return``;if(!r.startsWith(a))return null;let o=e.slice(a.length);return n===`\\`?o.replaceAll(`\\`,`/`):o}async function cr(e,t={}){if((e.type||``).startsWith(`image/`))return rr(e);let n=t.absPathOf,r=t.workspaceContentDir,i=t.pathSeparator??`/`,a=e.name||`attachment`;if(n===void 0||r===void 0||r===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let o=n(e);if(o===null||o===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let s=sr(o,r,i);return s===null?{ok:!1,error:{kind:`outside-workspace`,name:a}}:{ok:!0,part:{kind:`file`,path:s,name:a}}}var lr=3,ur=lr*2+2;function dr(e){let t=e.split(`
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{$n as r,Dr as i,Gr as a,Zn as o,cr as s,er as c,i as l,qn as u,tr as d}from"./DocumentContext-C7cdXT-e.js";import{t as f}from"./react-f2sANaYj.js";import{n as p,r as m}from"./dist-Nvb76hAm.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{i as g,o as _}from"./local-menu-action-bus-BuSRFm5g.js";import{t as v}from"./utils-CPqDy6Hr.js";import{t as y}from"./mascot-outline-CtS592mc.js";import{t as b}from"./button-CA0dewJJ.js";import{i as x,n as S,t as C}from"./tooltip-DPvMEqsq.js";import{c as w,i as T,t as E}from"./dialog-BH80AfFt.js";import{Tt as D}from"./CodeMirrorPropInput-B2m6_Glf.js";import{c as O,d as k,f as A,l as j,m as M,n as N,o as P,p as F,r as ee,t as I}from"./dropdown-menu-BpLbh79a.js";import{a as te,c as ne,d as re,f as L,i as ie,l as ae,n as oe,o as R,p as se,r as ce,s as le,t as z,u as ue,v as B}from"./progress-CigYi-Tn.js";import{t as de}from"./switch-BeP1gMN6.js";import{Zr as fe,ft as pe}from"./dist-DSS3ixln2.js";import{n as me}from"./dist-CuH7ikCn.js";import{t as V}from"./dist-BIGNzOeF2.js";import{i as he,t as H}from"./history-BteF85_l.js";import{n as ge}from"./use-workspace-DriKk3ci.js";import{t as U}from"./createLucideIcon-CAkY8Blx.js";import{n as W,s as _e,u as ve}from"./Mermaid-NYQ6RsUB.js";import{t as ye}from"./RegisteredAgentIcon-Fkz5hv6G.js";import{t as G}from"./check-Bzwwm-o4.js";import{t as be}from"./chevron-down-xENV92Te.js";import{t as xe}from"./chevron-right-BVvjaUfh.js";import{o as K,r as Se,s as Ce}from"./prop-types-nOgQFiCi.js";import{n as we,t as q}from"./terminal-CFd7qrv_.js";import{t as Te}from"./list-plus-1_iMFVqs.js";import{t as Ee}from"./spinner-DmibE6UV.js";import{c as De,n as Oe,o as ke,s as Ae,t as je}from"./comment-chips-CBw_14rd.js";import{t as Me}from"./rotate-ccw-Dh7y6tzD.js";import{t as Ne}from"./square-pen-Blyr7NAu.js";import{t as Pe}from"./trash-2-BVoWHmfV.js";import{t as Fe}from"./wrench-JX3g_hHJ.js";import{t as Ie}from"./x-wQUDJS55.js";import{f as Le,s as Re}from"./doc-paths-oMq41Y7d.js";import{t as ze}from"./external-link-DGqXfQJy.js";import{t as Be}from"./badge-DGD9B_-e.js";import{t as Ve}from"./skeleton-DIxLroLR.js";import{t as He}from"./textarea-BtqZ3yY1.js";import{n as Ue}from"./agent-presence-C_iH_p3q.js";import{i as We,n as Ge}from"./chunk-BO2N2NFS-BVKS5mdX.js";import{n as Ke}from"./libesm-B7m5uxaw.js";import{a as qe,d as Je,f as Ye,m as Xe,n as Ze,p as Qe,r as $e,s as et}from"./thread-client-o-xHAmeK.js";import{n as tt}from"./thread-draft-staging-D-3dp2ov.js";var nt=U(`folder-input`,[[`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`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),rt=U(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),it=U(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),at=U(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),J=h(),ot=new RegExp([`bypass`,`acceptedits`,`fullaccess`,`autoedit`,`yolo`,`danger`,`fullauto`,`autoaccept`,`autoapprove`,`autorun`,`skippermission`,`noconfirm`,`noprompt`,`unrestricted`,`allowall`].join(`|`)),st=new Set([`auto`]);function ct(e){return e.toLowerCase().replace(/[^a-z]/g,``)}function lt(e){let t=ct(e.id),n=ct(e.name??``);return st.has(t)||st.has(n)?!0:ot.test(t)||ot.test(n)}var ut={"claude-acp":`asks`,"codex-acp":`self-managed`,cursor:`self-managed`,"pi-acp":`autonomous`};function dt(e,t,n){let r=n??(t==null?null:t.availableModes.find(e=>e.id===t.currentModeId)??null),i=ut[e];return i===void 0?t!=null&&t.availableModes.length>0?`self-managed`:`unknown`:i===`asks`&&r!==null&&lt(r)?`self-managed`:i}var Y=e(f(),1),X=n();function ft({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=pt(mt(r,i),t);if(!n)return Y.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!Y.isValidElement(n))return null;let o=n.props,s={...pt(a,o),ref:_t(a.ref,o.ref)};return Y.cloneElement(n,s)}function pt(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];n===`className`?t[n]=[i,r].filter(Boolean).join(` `):n===`style`?t[n]={...i,...r}:n===`ref`?t[n]=_t(i,r):gt(n)&&typeof i==`function`&&typeof r==`function`?t[n]=ht(r,i):t[n]=r}}return t}function mt(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function ht(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function gt(e){return/^on[A-Z]/.test(e)}function _t(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var vt=8,yt=64,bt=0,xt=.5,St=180,Ct=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),wt={start:!1,end:!1},Tt={currentAnchorId:null,visibleMessageIds:[]};function Et({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return wt;let i=Rt({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function Dt({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Tt;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of Ot(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+xt&&(u=e)}return l.length===0&&u===null?Tt:{currentAnchorId:u,visibleMessageIds:l}}function Ot(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function kt(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function At(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function jt(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Mt(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function Nt({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of Ot(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Pt({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Ft(t,i),o=t.getBoundingClientRect().height,s=Vt(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Ft(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function It(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function Lt({content:e,scrollTop:t,spacer:n,viewport:r}){let i=Rt({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function Rt({content:e,spacer:t,viewport:n}){let r=Ot(e,t),i=Bt(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function zt(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Bt(e){let t=window.getComputedStyle(e);return{end:Ut(t.paddingBlockEnd||t.paddingBottom),start:Ut(t.paddingBlockStart||t.paddingTop)}}function Vt(e){let t=e?.parentElement;return t?Bt(t):{end:0,start:0}}function Ht(e){if(!e)return 0;let t=window.getComputedStyle(e);return Ut(t.rowGap===`normal`?t.gap:t.rowGap)}function Ut(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Wt({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,defaultScrollPositionAppliedRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=Y.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},St))},[t]),S=Y.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=Y.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);if(Math.abs(a.scrollTop-o)<=xt){a.scrollTop=o,t();return}i&&x(!0),a.scrollTo({top:o,behavior:r}),n()},[t,n,x]),w=Y.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=Y.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(zt(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=Y.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=b.current;if(!s||!l||!s.contains(e))return!1;let u=Pt({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:l});return S(Lt({content:s,scrollTop:u,spacer:y.current,viewport:l})),m.current={element:e,viewportTop:It(e,l)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=Y.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=Y.useCallback((e,t)=>{let n=d.current.get(e);return n?(l.current=!0,E(n,t)?(p.current=null,!0):(p.current={messageId:e,options:t},!0)):u.current===0?(p.current={messageId:e,options:t},l.current=!0,!0):!1},[E]);return{flushPendingScrollToMessage:Y.useCallback(()=>{let e=p.current;if(!e)return!1;let t=d.current.get(e.messageId);return!t||!E(t,e.options)?!1:(p.current=null,l.current=!0,!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function Gt(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function Kt(e,t){return Gt(e,t)}function qt(){return Gt(Tt,Yt)}function Jt(e,t){return e.start===t.start&&e.end===t.end}function Yt(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function Xt({autoScroll:e,scrollEdgeThreshold:t,scrollMargin:n,scrollPreviousItemPeek:r}){let i=Y.useRef(e),a=Y.useRef(!1),o=Y.useRef(null),s=Y.useRef(!1),c=Y.useRef(t),l=Y.useRef(0),u=Y.useRef(null),d=Y.useRef(0),f=Y.useRef(e?`following-bottom`:`free-scrolling`),p=Y.useRef(new Map),m=Y.useRef(null),h=Y.useRef(null),g=Y.useRef(null),_=Y.useRef(r),v=Y.useRef(!0),y=Y.useRef(null),b=Y.useRef(n),x=Y.useRef(null),S=Y.useRef(0),C=Y.useRef(0),w=Y.useRef(null),T=Y.useRef(null),E=Y.useRef(null),D=Y.useRef(null),O=Y.useRef(null),k=Y.useRef(null),A=Y.useRef(null),j=Y.useRef(null),M=Y.useRef(new Set),N=Y.useRef(new WeakSet);return E.current===null&&(E.current=Kt(wt,Jt)),j.current===null&&(j.current=qt()),i.current=e,c.current=t,b.current=n,_.current=r,{autoScrollRef:i,autoscrollingRef:a,autoscrollingTimeoutRef:D,streamingTurnRef:g,contentRef:o,defaultScrollPositionAppliedRef:s,firstItemRef:u,itemCountRef:l,lastScrollTopRef:d,messageElementsRef:p,modeRef:f,pendingScrollFrameRef:x,pendingScrollToMessageRef:m,prependRestoreRef:h,preserveScrollOnPrependRef:v,rootRef:y,scrollEdgeThresholdRef:c,scrollMarginRef:b,scrollPreviousItemPeekRef:_,spacerGapRef:S,spacerHeightRef:C,spacerRef:w,stateFrameRef:T,stateStore:E.current,viewportRef:O,visibilityFrameRef:k,visibilityObserverRef:A,visibilityStore:j.current,visibleMessageIdsRef:M,handledScrollAnchorsRef:N}}function Zt(e,t){return Y.useCallback(n=>{e.current=n,n&&t()},[e,t])}function Qt({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=vt,scrollPreviousItemPeek:r=yt,scrollMargin:i=bt}){let a=Xt({autoScroll:e,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,rootRef:x,scrollEdgeThresholdRef:S,scrollMarginRef:C,scrollPreviousItemPeekRef:w,spacerGapRef:T,spacerHeightRef:E,spacerRef:D,stateFrameRef:O,stateStore:k,viewportRef:A,visibilityFrameRef:j,visibilityObserverRef:M,visibilityStore:N,visibleMessageIdsRef:P,handledScrollAnchorsRef:F}=a,ee=Y.useRef(t);ee.current!==t&&(ee.current=t,d.current=!1);let I=Y.useCallback(e=>{let t=x.current,n=A.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),te=Y.useCallback(e=>{let t=A.current?.scrollTop??0,n=t<m.current-xt;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),ne=Y.useCallback(()=>{let e=Et({content:u.current,scrollEdgeThreshold:S.current,spacer:D.current,viewport:A.current});te(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;I(t),k.setSnapshot(t)},[te,k,I]),re=Y.useCallback(()=>{O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,ne()}))},[ne]),L=Y.useCallback(()=>{N.hasListeners()&&j.current===null&&(j.current=window.requestAnimationFrame(()=>{j.current=null,N.hasListeners()&&N.setSnapshot(Dt({content:u.current,scrollMargin:C.current,scrollPreviousItemPeek:w.current,spacer:D.current,viewport:A.current,visibleMessageIds:P.current}))}))},[N]),{flushPendingScrollToMessage:ie,reanchorToAnchoredMessage:ae,scrollToElement:oe,scrollToEnd:R,scrollToMessage:se,scrollToStart:ce}=Wt({refs:a,commitScrollState:ne,scheduleStateCommit:re,scheduleVisibilitySync:L}),le=Y.useCallback(()=>{let e=y.current,t=A.current;if(!e||!t||!e.element.isConnected)return!1;let n=It(e.element,t)-e.viewportTop;return Math.abs(n)<=xt?!1:(t.scrollTop+=n,e.viewportTop=It(e.element,t),re(),L(),!0)},[re,L]),z=Y.useCallback(()=>{let e=u.current,t=A.current;if(!e||!t){y.current=null;return}let n=Nt({content:e,spacer:D.current,viewport:t});y.current=n?{element:n,viewportTop:It(n,t)}:null},[]),ue=Y.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,ie()&&z()}))},[z,ie]),B=Y.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=A.current,r=t&&n?Mt(Ot(t,D.current)):null;if(!t||!n||!r)e=R({behavior:`auto`});else{let i=Ft(r,n);e=Rt({content:t,spacer:D.current,viewport:n})-i<=n.clientHeight?R({behavior:`auto`}):oe(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?R({behavior:`auto`}):ce({behavior:`auto`});return e?(d.current=!0,!0):!1},[t,oe,R,ce]),de=Y.useCallback(()=>{let e=u.current;if(!e)return;let t=Ot(e,D.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(ie())return;if(n===0){if(B()||t.length>0&&s.current&&R({behavior:`auto`}))return;ne(),L();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0){le();return}if(t.length>n){let e=kt(t,n);if(e){if(s.current&&g.current===`following-bottom`&&jt(t,n)){R({behavior:`auto`});return}oe(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}if(t.length===n){let e=At(t,F.current);if(e){oe(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}g.current===`following-bottom`&&s.current?R({behavior:`auto`}):(ne(),L())})(),z()},[B,z,ne,ie,le,L,oe,R]),fe=Y.useCallback(()=>{if(g.current===`following-bottom`&&s.current){R({behavior:`auto`});return}let e=E.current;if(ae()){s.current&&e>0&&E.current===0&&R({behavior:`auto`});return}re(),L()},[ae,re,L,R]),pe=Y.useCallback(()=>{let e=A.current;if(!(!e||!N.hasListeners())){if(typeof IntersectionObserver>`u`){L();return}M.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?P.current.add(e):P.current.delete(e))}L()},{root:e,rootMargin:`${-(C.current+w.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{M.current?.observe(e)}),L()}},[L,N]),me=Y.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),M.current?.disconnect(),M.current=null,P.current.clear(),N.setSnapshot(Tt)},[N]),V=Y.useCallback((e,t,n)=>{if(t){h.current.set(e,t),M.current?.observe(t),L(),v.current?.messageId===e&&ue();return}n&&h.current.get(e)===n&&(h.current.delete(e),P.current.delete(e),M.current?.unobserve(n),L())},[ue,L]),he=Y.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),H=Y.useCallback(()=>I(k.getSnapshot()),[k,I]),ge=Zt(x,H),U=Zt(A,H),W=Y.useCallback(e=>{u.current=e},[]),_e=Y.useCallback(e=>{D.current=e,T.current=Ht(e?.parentElement??null)},[]),ve=Y.useCallback(()=>{ne(),L(),z()},[z,ne,L]),ye=Y.useMemo(()=>({handleContentChange:de,handleResize:fe,observeVisibility:pe,preserveScrollOnPrependRef:b,scrollToEnd:R,scrollToMessage:se,scrollToStart:ce,setContentElement:W,setRootElement:ge,setSpacerElement:_e,setViewportElement:U,stateStore:k,syncAfterScroll:ve,unobserveVisibility:me,userScrollIntent:he,viewportRef:A,visibilityStore:N}),[de,fe,pe,R,se,ce,W,ge,_e,U,k,ve,me,he,N]);return Y.useLayoutEffect(()=>{B()},[B]),Y.useEffect(()=>()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),M.current?.disconnect(),M.current=null},[]),Y.useLayoutEffect(()=>{if(e&&g.current===`following-bottom`&&p.current>0){R({behavior:`auto`});return}ne()},[e,ne,R]),{context:ye,registerMessage:V}}function $t(e){let t=Y.useRef(e);return t.current=e,t}var en=Y.createContext(null),tn=Y.createContext(null);function nn(){let e=Y.useContext(en);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function rn(){let e=Y.useContext(tn);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function an(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=nn();return Y.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function on({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=Qt({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,X.jsx)(en.Provider,{value:o,children:(0,X.jsx)(tn.Provider,{value:s,children:t})})}function sn({children:e,...t}){let{setRootElement:n}=nn();return(0,X.jsx)(`div`,{ref:n,...t,children:e})}function cn({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=nn();f.current=o;let _=Y.useCallback(e=>{p(e),_t(s)?.(e)},[s,p]);function v(e){m(),r?.(e)}function y(e){h(),a?.(e)}function b(e){h(),i?.(e)}function x(e){Ct.has(e.key)&&h(),n?.(e)}return Y.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,X.jsx)(`div`,{ref:_,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:x,onScroll:v,onTouchMove:b,onWheel:y,...u,children:t})}function ln({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=nn(),u=Y.useRef(null),d=Y.useCallback(e=>{u.current=e,c(e),_t(n)?.(e)},[n,c]);return Y.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),Y.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,X.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,X.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function un({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=rn(),a=Y.useRef(null);return(0,X.jsx)(`div`,{ref:Y.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),_t(t)?.(n)},[e,t,i]),"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function dn({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=nn(),d=$t(r),f=Y.useCallback(e=>u.subscribe(e),[u]),p=Y.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=Y.useSyncExternalStore(f,p,p),h=Y.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return ft({defaultTagName:`button`,props:pt({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,X.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var fn={Provider:on,Root:sn,Viewport:cn,Content:ln,Item:un,Button:dn};function pn(e){let t=(0,J.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(fn.Provider,{...e}),t[0]=e,t[1]=n),n}function mn(e){let t=(0,J.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(fn.Root,{"data-slot":`message-scroller`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hn(e){let t=(0,J.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`size-full min-h-0 min-w-0 scrollbar-thin overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(fn.Viewport,{"data-slot":`message-scroller-viewport`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gn(e){let t=(0,J.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`flex h-max min-h-full flex-col gap-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(fn.Content,{"data-slot":`message-scroller-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _n(e){let t=(0,J.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scrollAnchor:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?!1:i,o;t[4]===n?o=t[5]:(o=v(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,X.jsx)(fn.Item,{"data-slot":`message-scroller-item`,scrollAnchor:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function vn(e){let t=(0,J.c)(25),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({direction:o,className:r,children:n,render:a,variant:s,size:c,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`end`:o,u=s===void 0?`secondary`:s,d=c===void 0?`icon-sm`:c,f;t[8]===r?f=t[9]:(f=v(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,r),t[8]=r,t[9]=f);let m;t[10]!==a||t[11]!==d||t[12]!==u?(m=a??(0,X.jsx)(b,{variant:u,size:d}),t[10]=a,t[11]=d,t[12]=u,t[13]=m):m=t[13];let h;t[14]!==n||t[15]!==l?(h=n??(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ve,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`sr-only`,children:l===`end`?(0,X.jsx)(p,{id:`EQXPXf`}):(0,X.jsx)(p,{id:`b1FDss`})})]}),t[14]=n,t[15]=l,t[16]=h):h=t[16];let g;return t[17]!==l||t[18]!==i||t[19]!==d||t[20]!==f||t[21]!==m||t[22]!==h||t[23]!==u?(g=(0,X.jsx)(fn.Button,{"data-slot":`message-scroller-button`,"data-direction":l,"data-variant":u,"data-size":d,direction:l,className:f,render:m,...i,children:h}),t[17]=l,t[18]=i,t[19]=d,t[20]=f,t[21]=m,t[22]=h,t[23]=u,t[24]=g):g=t[24],g}var yn=new Map,bn=0;function xn(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Sn(){let e=xn();for(let[t,n]of yn)t((e-n)/1e3);if(yn.size===0){bn=0;return}bn=requestAnimationFrame(Sn)}function Cn(e){return yn.set(e,xn()),bn===0&&typeof requestAnimationFrame==`function`&&(bn=requestAnimationFrame(Sn)),()=>{yn.delete(e),yn.size===0&&bn!==0&&(cancelAnimationFrame(bn),bn=0)}}var Z=40,wn=15,Q=15,$=12.4,Tn={blobby:0,triangle:1,square:2,sparkle:3,pentagon:4,hexagon:5,dot:6,star5:7,clover:8,star6:9,scallop:10,comma:11,diamond:12,cloud:13},En=`M15.34 2.91C15.96 2.77 16.69 2.65 17.33 2.63C17.97 2.62 18.72 2.71 19.36 2.84C20.00 2.97 20.79 3.10 21.33 3.44C21.88 3.79 22.38 4.46 22.75 5.01C23.12 5.56 23.42 6.30 23.66 6.89C23.90 7.49 24.06 8.18 24.26 8.73C24.45 9.28 24.66 9.84 24.89 10.34C25.12 10.84 25.39 11.36 25.68 11.85C25.97 12.34 26.46 12.87 26.71 13.41C26.96 13.94 27.12 14.61 27.26 15.21C27.39 15.80 27.54 16.52 27.55 17.14C27.56 17.76 27.43 18.47 27.30 19.09C27.16 19.71 26.99 20.43 26.72 21.01C26.46 21.58 26.05 22.20 25.64 22.69C25.22 23.17 24.65 23.63 24.15 24.02C23.66 24.41 23.09 24.82 22.55 25.14C22.02 25.45 21.39 25.74 20.84 25.99C20.28 26.25 19.65 26.52 19.08 26.70C18.50 26.89 17.83 27.05 17.23 27.15C16.63 27.26 15.95 27.34 15.34 27.37C14.73 27.39 14.03 27.40 13.42 27.33C12.81 27.26 12.12 27.10 11.54 26.92C10.95 26.73 10.30 26.47 9.75 26.18C9.20 25.90 8.62 25.51 8.11 25.15C7.61 24.80 7.06 24.37 6.60 23.94C6.15 23.52 5.68 23.00 5.28 22.52C4.89 22.03 4.47 21.45 4.13 20.92C3.79 20.38 3.41 19.75 3.16 19.16C2.91 18.57 2.68 17.86 2.56 17.23C2.45 16.60 2.42 15.85 2.45 15.21C2.48 14.56 2.60 13.83 2.76 13.22C2.93 12.60 3.18 11.91 3.47 11.35C3.77 10.80 4.24 10.23 4.63 9.75C5.01 9.27 5.45 8.74 5.89 8.34C6.34 7.95 6.93 7.61 7.40 7.27C7.88 6.94 8.38 6.57 8.83 6.25C9.29 5.93 9.79 5.56 10.27 5.25C10.75 4.95 11.29 4.61 11.81 4.33C12.32 4.05 12.92 3.74 13.49 3.52C14.05 3.29 14.73 3.05 15.34 2.91Z`,Dn=2.26,On=`M76.4805 11.041C99.1124 7.04848 118.186 8.33731 134.31 14.4102C150.369 20.4588 164.177 31.5065 175.929 48.1846L176.446 48.9199C187.179 64.5695 195.653 90.2797 191.323 112.539C186.344 138.13 169.219 160.474 150.105 178.107C131.113 195.629 111.037 207.691 101.728 212.842C98.3779 214.693 93.3915 217.316 88.0508 217.316C85.74 217.316 83.6583 216.814 81.7607 215.855L81.3838 215.658C75.1451 212.251 73.9381 205.91 73.376 198.68L73.2705 197.222C72.953 192.5 72.5095 188.039 71.1416 184.247C69.5395 179.806 66.852 176.673 63.1406 174.227L63.1377 174.225C41.2846 159.832 21.8495 144.226 13.3828 121.439L13.3818 121.438L13.0146 120.427C5.46004 99.1404 7.95139 74.5467 20.4404 52.7568L20.4414 52.7549C33.2945 30.3176 54.4303 14.925 76.4785 11.041H76.4805Z`;function kn(e){let t=t=>{let n=e[(t-1+Z)%Z],r=e[(t+1)%Z];return[(r[0]-n[0])*.16,(r[1]-n[1])*.16]},n=`M${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let r=0;r<Z;r++){let i=e[r],a=e[(r+1)%Z],o=t(r),s=t((r+1)%Z);n+=`C${(i[0]+o[0]).toFixed(2)} ${(i[1]+o[1]).toFixed(2)} ${(a[0]-s[0]).toFixed(2)} ${(a[1]-s[1]).toFixed(2)} ${a[0].toFixed(2)} ${a[1].toFixed(2)}`}return`${n}Z`}function An(e,t){let n=e.map(e=>e[0]),r=e.map(e=>e[1]),i=Math.min(...n),a=Math.max(...n),o=Math.min(...r),s=Math.max(...r),c=t*2/Math.max(a-i,s-o);return e.map(e=>[wn+(e[0]-(i+a)/2)*c,Q+(e[1]-(o+s)/2)*c])}function jn(e,t,n){let r=e;for(let e=0;e<t;e++){let e=r;r=e.map((t,r)=>{let i=e[(r-1+Z)%Z],a=e[(r+1)%Z];return[t[0]*(1-n)+(i[0]+a[0])/2*n,t[1]*(1-n)+(i[1]+a[1])/2*n]})}return r}function Mn(){if(typeof document>`u`)return null;let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.style.position=`absolute`,e.style.visibility=`hidden`;let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);if(e.appendChild(t),document.body.appendChild(e),typeof t.getTotalLength!=`function`||typeof t.getPointAtLength!=`function`)return e.remove(),null;try{t.setAttribute(`d`,`M0 0L1 0`),t.getPointAtLength(0)}catch{return e.remove(),null}return t}function Nn(e){function t(t,n){e.setAttribute(`d`,t);let r=e.getTotalLength(),i=[];for(let t=0;t<n;t++){let a=e.getPointAtLength(r*t/n);i.push([a.x,a.y])}return i}function n(e){let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];t/=e.length,n/=e.length;let r=Array(Z).fill(0),i=Array(Z).fill(1/0);for(let a of e){let e=Math.atan2(a[1]-n,a[0]-t),o=Math.hypot(a[0]-t,a[1]-n),s=Math.round((e+Math.PI/2)/(2*Math.PI)*Z);s=(s%Z+Z)%Z,o>r[s]&&(r[s]=o),o<i[s]&&(i[s]=o)}return{cx:t,cy:n,hi:r,lo:i}}function r(e,t,n){return e.map((e,r)=>{let i=-Math.PI/2+r*2*Math.PI/Z;return[t+Math.cos(i)*e,n+Math.sin(i)*e]})}function i(e,i){let{cx:a,cy:o,hi:s,lo:c}=n(t(e,1080)),l=s.map((e,t)=>(e+c[t])/2),u=s.reduce((e,t,n)=>e+(t-c[n]),0)/Z,d=r(l,a,o),f=d.map(e=>e[0]),p=d.map(e=>e[1]),m=i*2/Math.max(Math.max(...f)-Math.min(...f),Math.max(...p)-Math.min(...p));return{path:kn(An(d,i)),strokeWidth:u*m}}function a(e,i){let{cx:a,cy:o,hi:s}=n(t(e,1400));return kn(An(r(s.map((e,t)=>s[t]*.86+(s[(t-1+Z)%Z]+s[(t+1)%Z])*.07),a,o),i))}function o(e,n){return kn(An(t(e,Z),n))}function s(e,n,r){return kn(jn(t(e,Z),n,r))}function c(e,n,r){return kn(t(e,Z).map(e=>[wn+(e[0]-wn)*n,Q+(e[1]-Q)*r]))}function l(e,n,r=1){return kn(t(e,Z).map((e,t)=>{let i=t*2*Math.PI/Z,a=1+r*(.035*Math.sin(i*3+n)+.025*Math.sin(i*5+n*2)+.018*Math.sin(i*2-n));return[wn+(e[0]-wn)*a,Q+(e[1]-Q)*a]}))}function u(e,t,n,r=0){let i=[];for(let n=0;n<e;n++){let a=-Math.PI/2+n*2*Math.PI/e+r;i.push([wn+Math.cos(a)*t,Q+Math.sin(a)*t])}let a=(e,t)=>{let n=t[0]-e[0],r=t[1]-e[1],i=Math.hypot(n,r);return[n/i,r/i]},o=``;for(let t=0;t<e;t++){let r=i[t],s=a(r,i[(t-1+e)%e]),c=a(r,i[(t+1)%e]),l=[r[0]+s[0]*n,r[1]+s[1]*n],u=[r[0]+c[0]*n,r[1]+c[1]*n];o+=`${t?`L`:`M`}${l[0].toFixed(2)} ${l[1].toFixed(2)}A${n} ${n} 0 0 1 ${u[0].toFixed(2)} ${u[1].toFixed(2)}`}return`${o}Z`}function d(e,n,r,i){let a=``;for(let t=0;t<e*2;t++){let i=-Math.PI/2+t*Math.PI/e,o=t%2?r:n;a+=`${t?`L`:`M`}${(wn+Math.cos(i)*o).toFixed(2)} ${(Q+Math.sin(i)*o).toFixed(2)}`}return kn(An(jn(t(`${a}Z`,Z),i,.3),n))}function f(e,n,r){let i=t=>{let n=-Math.PI/2+t*Math.PI/2;return[wn+Math.cos(n)*e,Q+Math.sin(n)*e]},a=`M${i(0)[0].toFixed(2)} ${i(0)[1].toFixed(2)}`;for(let e=0;e<4;e++){let t=-Math.PI/2+(e+.5)*Math.PI/2,r=[wn+Math.cos(t)*n,Q+Math.sin(t)*n],o=i((e+1)%4);a+=`Q${r[0].toFixed(2)} ${r[1].toFixed(2)} ${o[0].toFixed(2)} ${o[1].toFixed(2)}`}return kn(An(jn(t(`${a}Z`,Z),r,.34),e))}function p(e,t,n,r){let i=[];for(let a=0;a<Z;a++){let o=-Math.PI/2+a*2*Math.PI/Z,s=(1+Math.cos(e*(o+Math.PI/2)))/2,c=n+(t-n)*s**r;i.push([wn+Math.cos(o)*c,Q+Math.sin(o)*c])}return kn(i)}function m(e){let t=[];for(let n=0;n<Z;n++){let r=-Math.PI/2+n*2*Math.PI/Z;t.push([wn+Math.cos(r)*e,Q+Math.sin(r)*e])}return kn(t)}return{silhouette:i,hull:a,fit:o,soften:s,squeeze:c,wobble:l,poly:u,star:d,sparkle:f,lobed:p,dot:m,circle:(e,t,n)=>`M${e-n} ${t}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0`}}function Pn(){let e=Mn();if(e===null)return null;try{let t=Nn(e),n=t.silhouette(y,12.55);return{paths:[n.path,t.wobble(t.poly(3,$*1.16,$*.5,.1),1.1),t.wobble(t.poly(4,$*1.02,$*.44),2.3),t.wobble(t.sparkle($*1.24,$*.1,3),3.7),t.wobble(t.poly(5,$*1,$*.38),4.9),t.wobble(t.poly(6,$*.98,$*.34),6.2),t.wobble(t.dot($*.34),2.8),t.wobble(t.star(5,$*1.14,$*.68,6),7.4),t.wobble(t.soften(t.lobed(4,$*1.16,$*.46,.5),3,.3),8.1),t.wobble(t.star(6,$*1.2,$*.42,4),9.3),t.wobble(t.lobed(8,$*1.06,$*.74,.6),10.5),t.wobble(t.soften(t.fit(On,$*1.12),3,.22),11.7,.3),t.wobble(t.squeeze(t.poly(4,$*1.3,$*.2),.84,1),12.9),t.wobble(t.hull(t.circle(10.2,16,4.3)+t.circle(15,12,5.5)+t.circle(20,15.4,4.4)+t.circle(15,17.4,5.2),12.4),13.6)],strokeWidth:n.strokeWidth}}finally{e.ownerSVGElement?.remove()}}var Fn;function In(){return Fn===void 0&&(Fn=Pn()),Fn}var Ln=/-?\d+(?:\.\d+)?/g;function Rn(e){return{fragments:e[0].split(Ln),numbers:e.map(e=>(e.match(Ln)??[]).map(Number))}}function zn(e,t){let n=``;for(let r=0;r<t.length;r++)n+=e[r]+t[r].toFixed(2);return n+e[t.length]}function Bn(e){return e<.5?2*e*e:1-2*(1-e)**2}var Vn=.58;function Hn(e,t,n,r){let i=t-1,a=n/i,o=e%n,s=Math.max(0,Math.min(i-1,Math.floor(o/a))),c=o%a/a;return{from:s,to:s+1,t:Bn(r?Math.min(1,c/Vn):c)}}var Un=Tn,Wn=[Un.blobby,Un.triangle,Un.square,Un.sparkle,Un.comma,Un.pentagon,Un.hexagon,Un.blobby],Gn={[Un.comma]:-2.9},Kn={leftCx:10.9,rightCx:18.1,cy:16,rx:1.25,ry:1.9},qn=20,Jn=8.4;function Yn(e){let t=(0,J.c)(22),{status:n,className:r,testId:i}=e,{_:a}=m(),o=(0,Y.useRef)(null),s=(0,Y.useRef)(null),c=W(),l,u;t[0]===c?(l=t[1],u=t[2]):(l=()=>{let e=o.current;if(e===null)return;if(c){e.setAttribute(`d`,En),e.setAttribute(`stroke-width`,String(Dn)),s.current?.removeAttribute(`transform`);return}let t=In();if(t===null)return;e.setAttribute(`stroke-width`,t.strokeWidth.toFixed(2));let n=Rn(t.paths),r=NaN,i=``;return Cn(t=>{let{from:a,to:o,t:c}=Hn(t,Wn.length,Jn,!0),l=n.numbers[Wn[a]],u=n.numbers[Wn[o]],d=l.map((e,t)=>e+(u[t]-e)*c),f=zn(n.fragments,d);f!==i&&(i=f,e.setAttribute(`d`,f));let p=s.current;if(p===null)return;let m=Gn[Wn[a]]??0,h=m+((Gn[Wn[o]]??0)-m)*c;h!==r&&(r=h,p.setAttribute(`transform`,`translate(0 ${h.toFixed(2)})`))})},u=[c],t[0]=c,t[1]=l,t[2]=u),(0,Y.useEffect)(l,u);let[d,f]=(0,Y.useState)(``),p,h;t[3]===a?(p=t[4],h=t[5]):(p=()=>{f(a({id:`DCSSZt`}))},h=[a],t[3]=a,t[4]=p,t[5]=h),(0,Y.useEffect)(p,h);let g;t[6]===r?g=t[7]:(g=v(`ok-working-enter flex items-center gap-2`,r),t[6]=r,t[7]=g);let _;t[8]===d?_=t[9]:(_=(0,X.jsx)(`span`,{"aria-live":`polite`,className:`sr-only`,role:`status`,children:d}),t[8]=d,t[9]=_);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(`path`,{ref:o,d:En,fill:`none`,stroke:`currentColor`,strokeWidth:Dn,strokeLinejoin:`round`,strokeLinecap:`round`}),t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(`span`,{className:`grid shrink-0 place-items-center text-muted-foreground/80`,children:(0,X.jsx)(`svg`,{width:qn,height:qn,viewBox:`0 0 30 30`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,className:`ok-working-pop ok-working-squint block shrink-0 overflow-visible`,children:(0,X.jsxs)(`g`,{className:`ok-working-group`,children:[y,(0,X.jsxs)(`g`,{ref:s,children:[(0,X.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Kn.leftCx,cy:Kn.cy,rx:Kn.rx,ry:Kn.ry,fill:`currentColor`}),(0,X.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Kn.rightCx,cy:Kn.cy,rx:Kn.rx,ry:Kn.ry,fill:`currentColor`})]})]})})}),t[11]=b):b=t[11];let x;t[12]===n?x=t[13]:(x=(0,X.jsx)(`span`,{className:`shimmer`,children:n}),t[12]=n,t[13]=x);let S;t[14]!==n||t[15]!==x?(S=(0,X.jsx)(`span`,{className:`ok-working-status text-sm`,children:x},n),t[14]=n,t[15]=x,t[16]=S):S=t[16];let C;return t[17]!==S||t[18]!==g||t[19]!==_||t[20]!==i?(C=(0,X.jsxs)(`div`,{className:g,"data-testid":i,children:[_,b,S]}),t[17]=S,t[18]=g,t[19]=_,t[20]=i,t[21]=C):C=t[21],C}function Xn(e){let t=[];for(let n of e.options)`value`in n?t.push(n):t.push(...n.options);return t}function Zn(e){let t=Xn(e),n=t.find(t=>t.value===e.currentValue);if(n===void 0||n.value!==`default`||!n.description)return null;let r=t.find(e=>e.value!==n.value&&e.description===n.description);return r===void 0?null:V._({id:`GK5Ft_`,values:{0:r.name}})}function Qn(e,t,n){return e===`claude-acp`&&t===`effort`&&n===`default`?V._({id:`3SWNP8`}):e===`codex-acp`&&t===`collaboration_mode`&&n===`default`?V._({id:`R6ABfU`}):null}var $n=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),er=700*1024;function tr(e){if(e.kind===`unsupported-type`)return e.mimeType.startsWith(`image/`)?`Only PNG, JPEG, GIF, and WebP images are supported (got ${e.mimeType}).`:`Unsupported file type: ${e.mimeType||`unknown`}.`;if(e.kind===`outside-workspace`)return`${e.name} is outside the workspace. Move it into your project first.`;if(e.kind===`unknown-path`)return`${e.name} has no resolvable path — the agent can only read files inside the workspace.`;let t=(e.limitBytes/(1024*1024)).toFixed(1);return`File is too large (${(e.sizeBytes/(1024*1024)).toFixed(1)} MB) — max ${t} MB per attachment.`}async function nr(e){let t=await new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`FileReader failed`)),r.onload=()=>{let e=r.result;if(typeof e!=`string`){n(Error(`FileReader returned non-string result`));return}t(e)},r.readAsDataURL(e)}),n=t.indexOf(`,`);return{data:n>=0?t.slice(n+1):t,mimeType:e.type||`application/octet-stream`,name:e.name||`image`,sizeBytes:e.size}}async function rr(e){let t=e.type||``;if(!$n.has(t))return{ok:!1,error:{kind:`unsupported-type`,mimeType:t}};if(e.size>716800)return{ok:!1,error:{kind:`too-large`,sizeBytes:e.size,limitBytes:er}};let n=await nr(e);return{ok:!0,part:{kind:`image`,data:n.data,mimeType:n.mimeType,name:n.name,sizeBytes:n.sizeBytes}}}function ir(e){return or(e,e=>e.type.startsWith(`image/`))}function ar(e){return or(e,e=>e.size>0)}function or(e,t){if(e===null)return[];let n=[],r=e=>{e!==null&&t(e)&&n.push(e)},i=!1,a=e.items;if(a)for(let e=0;e<a.length;e+=1){let t=a[e];if(!t||t.kind!==`file`)continue;let n=t.getAsFile();n!==null&&(i=!0,r(n))}if(!i){let t=e.files;if(t)for(let e=0;e<t.length;e+=1)r(t[e]??null)}return n}function sr(e,t,n){let r=n===`\\`?e.toLowerCase():e,i=n===`\\`?t.toLowerCase():t,a=i.endsWith(n)?i:`${i}${n}`;if(r===i)return``;if(!r.startsWith(a))return null;let o=e.slice(a.length);return n===`\\`?o.replaceAll(`\\`,`/`):o}async function cr(e,t={}){if((e.type||``).startsWith(`image/`))return rr(e);let n=t.absPathOf,r=t.workspaceContentDir,i=t.pathSeparator??`/`,a=e.name||`attachment`;if(n===void 0||r===void 0||r===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let o=n(e);if(o===null||o===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let s=sr(o,r,i);return s===null?{ok:!1,error:{kind:`outside-workspace`,name:a}}:{ok:!0,part:{kind:`file`,path:s,name:a}}}var lr=3,ur=lr*2+2;function dr(e){let t=e.split(`
3
3
  `);return t[t.length-1]===``&&t.pop(),t}function fr(e,t){if(e===null)return dr(t).map(e=>({type:`add`,text:e}));let n=[],r=Ke(e,t);for(let[e,t]of r.entries()){let i=dr(t.value);if(t.added){for(let e of i)n.push({type:`add`,text:e});continue}if(t.removed){for(let e of i)n.push({type:`del`,text:e});continue}if(i.length<=ur){for(let e of i)n.push({type:`ctx`,text:e});continue}let a=e>0?i.slice(0,lr):[],o=e<r.length-1?i.slice(-lr):[];for(let e of a)n.push({type:`ctx`,text:e});n.push({type:`gap`,count:i.length-a.length-o.length});for(let e of o)n.push({type:`ctx`,text:e})}return n}var pr=/^\[[^\]]{1,32}\]\s*/,mr=/\bhttps?:\/\/\S+/,hr=/\b[A-Z0-9]{3,8}(?:-[A-Z0-9]{3,8})+\b/;function gr(e){try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}}function _r(e){let t,n,r=[];for(let i of e){let e=i.replace(pr,``).trim();if(e===``)continue;let a=e.match(mr);if(n===void 0&&a!==null){n=a[0].replace(/[).,]+$/,``);let e=new URLSearchParams(n.split(`?`)[1]??``).get(`user_code`);e!==null&&e!==``&&(t=e)}if(t===void 0){let n=e.match(hr);n!==null&&(t=n[0])}let o=t!==void 0&&e.includes(t),s=n!==void 0&&e.includes(n);!o&&!s&&r.push(e)}return{...t===void 0?{}:{code:t},...n===void 0?{}:{url:n},lines:r}}var vr=/\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]/g;function yr(e){return e.replace(vr,``)}function br(e){return yr(e).split(`
4
4
  `).map(e=>{let t=e.replace(/\r+$/,``),n=t.lastIndexOf(`\r`);return n===-1?t:t.slice(n+1)}).join(`
5
5
  `)}var xr=new Set(pe),Sr=/^(?:open[-_ ]?knowledge|ok)$/,Cr=/^(?:mcp[^a-z0-9]+)?(?:open[-_ ]?knowledge|ok)[^a-z0-9]+([a-z_]+)$/;function wr(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function Tr(e){return Cr.exec(e.trim().toLowerCase())?.[1]??null}function Er(e,t){let n=ae(wr(t),`server`);if(n!==null&&!Sr.test(n.toLowerCase()))return null;let r=ue(t),i=[Tr(e),r?.tool??null].find(e=>e!==null&&xr.has(e));return i===void 0?null:{tool:i,args:r?.args??{}}}function Dr(e){return typeof e==`string`?e.trim()===``?[]:[e.trim()]:Array.isArray(e)?e.flatMap(Dr):typeof e==`object`&&e?Dr(e.path):[]}var Or=[`document`,`documents`,`folder`,`file`,`template`,`asset`,`path`,`from`,`name`];function kr(e){for(let t of Or){let n=Dr(e[t]);if(n.length>0)return n}return[]}function Ar(e){return e.replace(/\.mdx?$/i,``)}var jr=120;function Mr(e){if(typeof e!=`string`)return null;let t=e.replace(/\s+/g,` `).trim();return t===``?null:t.length>jr?`${t.slice(0,jr-1)}…`:t}function Nr(e,t){let n=kr(t),r=n[0],i=n.length>1?V._({id:`C7waqI`,values:{0:n.length}}):r===void 0?null:Ar(r);switch(e){case`write`:return{glyph:`edit`,text:i===null?V._({id:`tLX6LY`}):V._({id:`MvWBwz`,values:{subject:i}})};case`edit`:return{glyph:`edit`,text:i===null?V._({id:`Fx9aOF`}):V._({id:`7aNk5D`,values:{subject:i}})};case`delete`:return{glyph:`delete`,text:i===null?V._({id:`DcFr-y`}):V._({id:`Gb_h4G`,values:{subject:i}})};case`move`:{let e=Dr(t.to)[0];if(i===null||e===void 0)return{glyph:`move`,text:V._({id:`RGptDW`})};let n=Ar(e);return{glyph:`move`,text:V._({id:`pbyEp3`,values:{subject:i,destination:n}})}}case`search`:{let e=Mr(t.query);return{glyph:`search`,text:e===null?V._({id:`EvXKHE`}):V._({id:`yWfjqS`,values:{query:e}})}}case`exec`:{let e=Mr(t.command);return{glyph:`execute`,text:e===null?V._({id:`FS4Udk`}):V._({id:`a5gwRt`,values:{command:e}})}}case`lint`:case`audit`:return{glyph:`check`,text:i===null?V._({id:`7S7FNA`}):V._({id:`TEJiKw`,values:{subject:i}})};case`links`:return{glyph:`link`,text:i===null?V._({id:`vallqD`}):V._({id:`KDrbNG`,values:{subject:i}})};case`history`:return{glyph:`history`,text:i===null?V._({id:`Ug2xzC`}):V._({id:`90-wKT`,values:{subject:i}})};case`config`:{let e=Mr(t.key);return{glyph:`settings`,text:e===null?V._({id:`ZwpggY`}):V._({id:`-oHckY`,values:{key:e}})}}case`skills`:return{glyph:`read`,text:V._({id:`4mp6Tv`})};case`install`:return{glyph:`install`,text:i===null?V._({id:`4ErgAf`}):V._({id:`WbWtif`,values:{subject:i}})};case`import`:{let e=Mr(t.skill)??Mr(t.source);return{glyph:`install`,text:e===null?V._({id:`DhT_PK`}):V._({id:`hCattk`,values:{source:e}})}}case`palette`:return{glyph:`read`,text:V._({id:`7czmD1`})};case`preview_url`:return{glyph:`fetch`,text:V._({id:`UL-9ej`})};case`share_link`:return{glyph:`share`,text:i===null?V._({id:`ABq-cq`}):V._({id:`ibE3-O`,values:{subject:i}})};case`checkpoint`:return{glyph:`history`,text:V._({id:`5b3WD-`})};case`conflicts`:return{glyph:`check`,text:V._({id:`i94lQe`})};case`resolve_conflict`:return{glyph:`edit`,text:i===null?V._({id:`_YWqV2`}):V._({id:`AeLo3p`,values:{subject:i}})};case`restore_version`:return{glyph:`restore`,text:i===null?V._({id:`caiyaU`}):V._({id:`hS0wC4`,values:{subject:i}})};default:return{glyph:`other`,text:V._({id:`vhGTWU`,values:{tool:e}})}}}var Pr={read:`read`,edit:`edit`,delete:`delete`,move:`move`,search:`search`,execute:`execute`,think:`think`,fetch:`fetch`,switch_mode:`switch_mode`};function Fr(e){let t=Er(e.title,e.rawInput);return t===null?{text:e.title,glyph:Pr[e.toolKind]??`other`}:Nr(t.tool,t.args)}var Ir=new Map([{id:`shellscript`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`tsx`,aliases:[`typescript`,`ts`,`jsx`]},{id:`javascript`,aliases:[`js`]},{id:`json`,aliases:[`jsonc`]},{id:`python`,aliases:[`py`]},{id:`rust`,aliases:[`rs`]},{id:`go`,aliases:[]},{id:`css`,aliases:[]},{id:`html`,aliases:[]},{id:`markdown`,aliases:[`md`]},{id:`yaml`,aliases:[`yml`]},{id:`toml`,aliases:[]},{id:`sql`,aliases:[]},{id:`diff`,aliases:[]},{id:`dockerfile`,aliases:[`docker`]}].flatMap(e=>[[e.id,e.id],...e.aliases.map(t=>[t,e.id])])),Lr=[`github-light`,`github-dark`],Rr=400,zr=new Map,Br=new Map;function Vr(e,t){return`${t}:${e.length}:${e.slice(0,100)}:${e.length>100?e.slice(-100):``}`}var Hr={name:`shiki`,type:`code-highlighter`,getSupportedLanguages:()=>Array.from(Ir.keys()),supportsLanguage:e=>Ir.has(e),getThemes:()=>Lr,highlight(e,n){let r=Ir.get(e.language)??`text`,i=Vr(e.code,r),a=zr.get(i);if(a!==void 0)return a;if(n!==void 0){let e=Br.get(i)??new Set;e.add(n),Br.set(i,e)}return t(async()=>{let{tokenize:e}=await import(`./code-highlighter-impl-CqBvFNiv.js`);return{tokenize:e}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(async({tokenize:t})=>{let n=await t(e.code,r);if(zr.size>=Rr){let e=Math.floor(zr.size/2);for(let t of zr.keys()){if(e===0)break;zr.delete(t),--e}}zr.set(i,n);let a=Br.get(i);if(a!==void 0){Br.delete(i);for(let e of a)e(n)}}).catch(e=>{Br.delete(i),console.warn(`[code-highlighter] highlight failed, leaving plain text`,e)}),null}};function Ur(){return e=>{Wr(e)}}function Wr(e){let t=e.children;if(t===void 0)return;let n=[];for(let e of t){if(e.type===`text`&&e.value!==void 0&&e.value.includes(`