@inkeep/open-knowledge 0.16.1-beta.0 → 0.16.1-beta.2

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 (47) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +6 -6
  4. package/dist/constants-CAptb0N8.mjs +2 -0
  5. package/dist/{dist--S8onIrO.mjs → dist-DI00wise.mjs} +1 -1
  6. package/dist/{dist-Br1AQTZl.mjs → dist-DK6nQomd.mjs} +7 -7
  7. package/dist/{gh-detect-DnwA-B1z.mjs → gh-detect-Dfl-0bCl.mjs} +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-BMMu5BcO.mjs → init-BQpZPydh.mjs} +4 -4
  10. package/dist/init-DAdXt_QS.mjs +1 -0
  11. package/dist/{loader-qSWystsO.mjs → loader-D-3m4SHj.mjs} +2 -2
  12. package/dist/loader-DQmeqm-m.mjs +1 -0
  13. package/dist/preview-BKW0q_VO.mjs +1 -0
  14. package/dist/{preview-BGWTw8Hu.mjs → preview-ClWdERYc.mjs} +2 -2
  15. package/dist/public/assets/{ActivityModeContent-CGpGpoNJ.js → ActivityModeContent-MZN4dhuA.js} +1 -1
  16. package/dist/public/assets/{DocumentContext-CJWIkwAG.js → DocumentContext-Dlz6eiMY.js} +2 -2
  17. package/dist/public/assets/{GraphPanel-C6eExsX4.js → GraphPanel-Ch6asGi2.js} +1 -1
  18. package/dist/public/assets/{OpenInAgentMenuRequestContext-CMr9VfoW.js → OpenInAgentMenuRequestContext-BaZwdwql.js} +1 -1
  19. package/dist/public/assets/{SettingsDialogBody-DzH36gmM.js → SettingsDialogBody-isrpM8KM.js} +1 -1
  20. package/dist/public/assets/SourceEditor-BmtVP-xk.js +2 -0
  21. package/dist/public/assets/{TerminalPanel-CWe8EYvn.js → TerminalPanel-Cjyt7ADc.js} +1 -1
  22. package/dist/public/assets/{config-validation-events-D8FXxNcc.js → config-validation-events-DirpEeMi.js} +1 -1
  23. package/dist/public/assets/{dist-CP3jvVRS.js → dist-BIbxx2ds.js} +1 -1
  24. package/dist/public/assets/{index-C2PYE0X-.js → index-DcWF4oGM.js} +96 -96
  25. package/dist/public/assets/{keyboard-shortcuts-AGKmTzB4.js → keyboard-shortcuts-DhU9JBBP.js} +1 -1
  26. package/dist/public/assets/{prop-types-rzyIIae9.js → prop-types-JdxpK0Ba.js} +1 -1
  27. package/dist/public/assets/{target-navigation-intent-BoX1aQk3.js → target-navigation-intent-h5JrxhMT.js} +1 -1
  28. package/dist/public/index.html +8 -8
  29. package/dist/{repair-launch-json-6xIm32Zo.mjs → repair-launch-json-Ccu4Z6Q0.mjs} +2 -2
  30. package/dist/{repair-mcp-configs-Dkm4l6uH.mjs → repair-mcp-configs-JlRpn-Ps.mjs} +2 -2
  31. package/dist/repair-skills-BRbSYbWT.mjs +1 -0
  32. package/dist/{repair-skills-CA90BNvr.mjs → repair-skills-fEOpZb8J.mjs} +2 -2
  33. package/dist/{server-lock-BpjJj3OD-DieV1RDy.mjs → server-lock-BpjJj3OD-7KPAM7xJ.mjs} +2 -2
  34. package/dist/server-lock-CyhBidkz-Cn1wgQoO.mjs +1 -0
  35. package/dist/{src-BLymKhjc.mjs → src-OUY65KUB.mjs} +2 -2
  36. package/dist/start-5uRw_j58.mjs +1 -0
  37. package/dist/{start-lBoQ1MZl.mjs → start-wwkIAl58.mjs} +2 -2
  38. package/dist/{write-project-skill-B6sZCIWR.mjs → write-project-skill-tUkoCT_R.mjs} +2 -2
  39. package/package.json +1 -1
  40. package/dist/constants-BG21qkwQ.mjs +0 -2
  41. package/dist/init-C0KhRWTF.mjs +0 -1
  42. package/dist/loader-B6Y12liH.mjs +0 -1
  43. package/dist/preview-uVWB0EMr.mjs +0 -1
  44. package/dist/public/assets/SourceEditor-B_TP4DPb.js +0 -2
  45. package/dist/repair-skills-Bv7y6ZgO.mjs +0 -1
  46. package/dist/server-lock-CyhBidkz-KHJ5sHjG.mjs +0 -1
  47. package/dist/start-Dx6fBnt_.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{o as e,r as t}from"./chunk-CFjPhJqf.js";import{a as n,i as r,o as i,r as a,t as o}from"./compiler-runtime-Cs91PcD2.js";import{Bn as s,Dn as c,Ln as l,Mn as u,Nn as d,On as f,R as p,Rn as m,Tn as h,Vn as g,Xn as _,_ as v,b as y,dr as b,h as x,ir as S,kn as C,m as w,n as T,rr as E,sr as D,tr as O,x as k}from"./DocumentContext-CJWIkwAG.js";import{An as A,Dt as j,L as M,Nn as N,R as P,Rn as F,Zn as I,_t as L,at as R,bt as z,cn as B,fn as V,gt as H,ht as U,ni as W,r as ee,vt as G}from"./dist-CP3jvVRS.js";import{c as te,d as ne,i as re,l as K,n as ie,o as ae,s as oe,t as q,u as se}from"./button-CmLxDlCv.js";import{i as ce}from"./toggle-group-oSLn0Q3B.js";import{_ as le,a as ue,c as de,g as fe,h as pe,i as me,m as he,n as ge,o as _e,r as ve,s as ye,t as be,v as xe}from"./dialog-uOgi9SAD.js";import{i as Se,n as Ce,o as we,r as Te,t as Ee}from"./collapsible-BzkAcCLq.js";import{B as De,F as Oe,H as ke,N as Ae,O as je,_ as Me,d as Ne,h as Pe,v as Fe,z as J}from"./prop-types-rzyIIae9.js";import{n as Ie,r as Le}from"./dist-DuNRfJxD.js";import{t as Re}from"./trace-api-DPMyR1_m.js";import{a as ze,d as Be,f as Ve,i as He,l as Ue,n as We,o as Ge,p as Ke,r as qe,s as Je}from"./dist-CSynDsuh.js";import{a as Ye,b as Xe,c as Ze,i as Qe,l as $e,n as et,o as tt,s as nt,t as rt,x as it}from"./tooltip-DjrmDp0P.js";import{n as at,t as ot}from"./checkbox-BlEgF5ZV.js";import{n as st,r as ct,t as lt}from"./dist-C_giuVsx.js";import{n as ut,r as dt,t as ft}from"./textarea-DV1qaluU.js";var pt=se(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),mt=se(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ht=se(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),gt=se(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),_t=se(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),vt=se(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),yt=se(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),bt=se(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),xt=se(`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`}]]),St=se(`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`}]]),Ct=se(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),wt=se(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Tt=se(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Et=se(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),Dt=se(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),Ot=se(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),kt=se(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),At=se(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),jt=se(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Mt=se(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Y=i(),X=e(n(),1),Nt=e(ne()),Z=o();async function Pt(e){try{let t=await e.json(),n=R.safeParse(t);if(n.success)return n.data.title}catch{}}async function Ft(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function It(e){let t=e.split(`
1
+ import{o as e,r as t}from"./chunk-CFjPhJqf.js";import{a as n,i as r,o as i,r as a,t as o}from"./compiler-runtime-Cs91PcD2.js";import{Bn as s,Dn as c,Ln as l,Mn as u,Nn as d,On as f,R as p,Rn as m,Tn as h,Vn as g,Xn as _,_ as v,b as y,dr as b,h as x,ir as S,kn as C,m as w,n as T,rr as E,sr as D,tr as O,x as k}from"./DocumentContext-Dlz6eiMY.js";import{An as A,Dt as j,L as M,Nn as N,R as P,Rn as F,Zn as I,_t as L,at as R,bt as z,cn as B,fn as V,gt as H,ht as U,ni as W,r as ee,vt as G}from"./dist-BIbxx2ds.js";import{c as te,d as ne,i as re,l as K,n as ie,o as ae,s as oe,t as q,u as se}from"./button-CmLxDlCv.js";import{i as ce}from"./toggle-group-oSLn0Q3B.js";import{_ as le,a as ue,c as de,g as fe,h as pe,i as me,m as he,n as ge,o as _e,r as ve,s as ye,t as be,v as xe}from"./dialog-uOgi9SAD.js";import{i as Se,n as Ce,o as we,r as Te,t as Ee}from"./collapsible-BzkAcCLq.js";import{B as De,F as Oe,H as ke,N as Ae,O as je,_ as Me,d as Ne,h as Pe,v as Fe,z as J}from"./prop-types-JdxpK0Ba.js";import{n as Ie,r as Le}from"./dist-DuNRfJxD.js";import{t as Re}from"./trace-api-DPMyR1_m.js";import{a as ze,d as Be,f as Ve,i as He,l as Ue,n as We,o as Ge,p as Ke,r as qe,s as Je}from"./dist-CSynDsuh.js";import{a as Ye,b as Xe,c as Ze,i as Qe,l as $e,n as et,o as tt,s as nt,t as rt,x as it}from"./tooltip-DjrmDp0P.js";import{n as at,t as ot}from"./checkbox-BlEgF5ZV.js";import{n as st,r as ct,t as lt}from"./dist-C_giuVsx.js";import{n as ut,r as dt,t as ft}from"./textarea-DV1qaluU.js";var pt=se(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),mt=se(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ht=se(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),gt=se(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),_t=se(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),vt=se(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),yt=se(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),bt=se(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),xt=se(`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`}]]),St=se(`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`}]]),Ct=se(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),wt=se(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Tt=se(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Et=se(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),Dt=se(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),Ot=se(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),kt=se(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),At=se(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),jt=se(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Mt=se(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Y=i(),X=e(n(),1),Nt=e(ne()),Z=o();async function Pt(e){try{let t=await e.json(),n=R.safeParse(t);if(n.success)return n.data.title}catch{}}async function Ft(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function It(e){let t=e.split(`
2
2
  `);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function Lt(){return{async status(e){let t=e?.host??`github.com`,n=await Ft(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Pt(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0}},async repos(e){let t=e?.host??`github.com`,n=await Ft(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await Pt(n)??`Failed to fetch repositories`};let r=It(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||`Failed to fetch repositories`}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:`Failed to fetch repositories`};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}},async signout(e){let t=await Ft(`/api/local-op/auth/signout`,e);return t.ok?{ok:!0}:{ok:!1,error:await Pt(t)}}}}function Rt(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function zt(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
3
3
  `);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Bt(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}function Vt(){return{start(){return Bt((e,t)=>{(async()=>{try{let n=await fetch(`/api/local-op/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({json:!0}),signal:t});if(!n.ok){let t=`Failed to start sign-in — try again`;try{let e=await n.json(),r=R.safeParse(e);r.success&&(t=r.data.title)}catch{}e({type:`error`,message:t});return}if(!n.body){e({type:`error`,message:`Failed to start sign-in — try again`});return}!await zt(n.body,t=>{let n;try{n=JSON.parse(t)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,t.slice(0,100)),`continue`}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let t=n.problem;return e({type:`error`,message:t?.detail||t?.title||`Unknown error`}),`terminal`}let r=n;return e(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})&&!t.aborted&&e({type:`error`,message:`Sign-in stream ended without confirmation — please try again`})}catch(t){if(t instanceof Error&&t.name===`AbortError`)return;e({type:`error`,message:`Connection error — try again`})}})()})}}}function Ht(e){return{start(){return e.localOp.auth.start()}}}function Ut(e,t){let n=window.okDesktop?.shell?.openExternal;n&&(e.preventDefault(),n(t))}var Wt=[`Enter`,` `],Gt=[`ArrowDown`,`PageUp`,`Home`],Kt=[`ArrowUp`,`PageDown`,`End`],qt=[...Gt,...Kt],Jt={ltr:[...Wt,`ArrowRight`],rtl:[...Wt,`ArrowLeft`]},Yt={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Xt=`Menu`,[Zt,Qt,$t]=it(Xt),[en,tn]=Be(Xt,[$t,$e,ct]),nn=$e(),rn=ct(),[an,on]=en(Xt),[sn,cn]=en(Xt),ln=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=nn(t),[c,l]=X.useState(null),u=X.useRef(!1),d=He(a),f=Xe(i);return X.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,Y.jsx)(Ze,{...s,children:(0,Y.jsx)(an,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,Y.jsx)(sn,{scope:t,onClose:X.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};ln.displayName=Xt;var un=`MenuAnchor`,dn=X.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nn(n);return(0,Y.jsx)(Ye,{...i,...r,ref:t})});dn.displayName=un;var fn=`MenuPortal`,[pn,mn]=en(fn,{forceMount:void 0}),hn=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=on(fn,t);return(0,Y.jsx)(pn,{scope:t,forceMount:n,children:(0,Y.jsx)(Ge,{present:n||a.open,children:(0,Y.jsx)(We,{asChild:!0,container:i,children:r})})})};hn.displayName=fn;var gn=`MenuContent`,[_n,vn]=en(gn),yn=X.forwardRef((e,t)=>{let n=mn(gn,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=on(gn,e.__scopeMenu),o=cn(gn,e.__scopeMenu);return(0,Y.jsx)(Zt.Provider,{scope:e.__scopeMenu,children:(0,Y.jsx)(Ge,{present:r||a.open,children:(0,Y.jsx)(Zt.Slot,{scope:e.__scopeMenu,children:o.modal?(0,Y.jsx)(bn,{...i,ref:t}):(0,Y.jsx)(xn,{...i,ref:t})})})})}),bn=X.forwardRef((e,t)=>{let n=on(gn,e.__scopeMenu),r=X.useRef(null),i=oe(t,r);return X.useEffect(()=>{let e=r.current;if(e)return he(e)},[]),(0,Y.jsx)(Cn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ue(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),xn=X.forwardRef((e,t)=>{let n=on(gn,e.__scopeMenu);return(0,Y.jsx)(Cn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Sn=re(`MenuContent.ScrollLock`),Cn=X.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=on(gn,n),_=cn(gn,n),v=nn(n),y=rn(n),b=Qt(n),[x,S]=X.useState(null),C=X.useRef(null),w=oe(t,C,g.onContentChange),T=X.useRef(0),E=X.useRef(``),D=X.useRef(0),O=X.useRef(null),k=X.useRef(`right`),A=X.useRef(0),j=m?pe:X.Fragment,M=m?{as:Sn,allowPinchZoom:!0}:void 0,N=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=sr(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};X.useEffect(()=>()=>window.clearTimeout(T.current),[]),fe();let P=X.useCallback(e=>k.current===O.current?.side&&lr(e,O.current?.area),[]);return(0,Y.jsx)(_n,{scope:n,searchRef:E,onItemEnter:X.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:X.useCallback(e=>{P(e)||(C.current?.focus(),S(null))},[P]),onTriggerLeave:X.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:D,onPointerGraceIntentChange:X.useCallback(e=>{O.current=e},[]),children:(0,Y.jsx)(j,{...M,children:(0,Y.jsx)(le,{asChild:!0,trapped:i,onMountAutoFocus:Ue(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,Y.jsx)(qe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,Y.jsx)(st,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:Ue(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Y.jsx)(nt,{role:`menu`,"aria-orientation":`vertical`,"data-state":nr(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:Ue(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=C.current;if(e.target!==i||!qt.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);Kt.includes(e.key)&&a.reverse(),ar(a)}),onBlur:Ue(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:Ue(e.onPointerMove,ur(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});yn.displayName=gn;var wn=`MenuGroup`,Tn=X.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Y.jsx)(Ve.div,{role:`group`,...r,ref:t})});Tn.displayName=wn;var En=`MenuLabel`,Dn=X.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Y.jsx)(Ve.div,{...r,ref:t})});Dn.displayName=En;var On=`MenuItem`,kn=`menu.itemSelect`,An=X.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=X.useRef(null),o=cn(On,e.__scopeMenu),s=vn(On,e.__scopeMenu),c=oe(t,a),l=X.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(kn,{bubbles:!0,cancelable:!0});e.addEventListener(kn,e=>r?.(e),{once:!0}),Ke(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,Y.jsx)(jn,{...i,ref:c,disabled:n,onClick:Ue(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Ue(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Ue(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Wt.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});An.displayName=On;var jn=X.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=vn(On,n),s=rn(n),c=X.useRef(null),l=oe(t,c),[u,d]=X.useState(!1),[f,p]=X.useState(``);return X.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,Y.jsx)(Zt.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,Y.jsx)(lt,{asChild:!0,...s,focusable:!r,children:(0,Y.jsx)(Ve.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Ue(e.onPointerMove,ur(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ue(e.onPointerLeave,ur(e=>o.onItemLeave(e))),onFocus:Ue(e.onFocus,()=>d(!0)),onBlur:Ue(e.onBlur,()=>d(!1))})})})}),Mn=`MenuCheckboxItem`,Nn=X.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,Y.jsx)(Vn,{scope:e.__scopeMenu,checked:n,children:(0,Y.jsx)(An,{role:`menuitemcheckbox`,"aria-checked":rr(n)?`mixed`:n,...i,ref:t,"data-state":ir(n),onSelect:Ue(i.onSelect,()=>r?.(rr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Nn.displayName=Mn;var Pn=`MenuRadioGroup`,[Fn,In]=en(Pn,{value:void 0,onValueChange:()=>{}}),Ln=X.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=He(r);return(0,Y.jsx)(Fn,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,Y.jsx)(Tn,{...i,ref:t})})});Ln.displayName=Pn;var Rn=`MenuRadioItem`,zn=X.forwardRef((e,t)=>{let{value:n,...r}=e,i=In(Rn,e.__scopeMenu),a=n===i.value;return(0,Y.jsx)(Vn,{scope:e.__scopeMenu,checked:a,children:(0,Y.jsx)(An,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ir(a),onSelect:Ue(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});zn.displayName=Rn;var Bn=`MenuItemIndicator`,[Vn,Hn]=en(Bn,{checked:!1}),Un=X.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Hn(Bn,n);return(0,Y.jsx)(Ge,{present:r||rr(a.checked)||a.checked===!0,children:(0,Y.jsx)(Ve.span,{...i,ref:t,"data-state":ir(a.checked)})})});Un.displayName=Bn;var Wn=`MenuSeparator`,Gn=X.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Y.jsx)(Ve.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Gn.displayName=Wn;var Kn=`MenuArrow`,qn=X.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nn(n);return(0,Y.jsx)(tt,{...i,...r,ref:t})});qn.displayName=Kn;var Jn=`MenuSub`,[Yn,Xn]=en(Jn),Zn=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=on(Jn,t),o=nn(t),[s,c]=X.useState(null),[l,u]=X.useState(null),d=He(i);return X.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,Y.jsx)(Ze,{...o,children:(0,Y.jsx)(an,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,Y.jsx)(Yn,{scope:t,contentId:ze(),triggerId:ze(),trigger:s,onTriggerChange:c,children:n})})})};Zn.displayName=Jn;var Qn=`MenuSubTrigger`,$n=X.forwardRef((e,t)=>{let n=on(Qn,e.__scopeMenu),r=cn(Qn,e.__scopeMenu),i=Xn(Qn,e.__scopeMenu),a=vn(Qn,e.__scopeMenu),o=X.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=X.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return X.useEffect(()=>u,[u]),X.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,Y.jsx)(dn,{asChild:!0,...l,children:(0,Y.jsx)(jn,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":nr(n.open),...e,ref:ae(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ue(e.onPointerMove,ur(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Ue(e.onPointerLeave,ur(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ue(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Jt[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});$n.displayName=Qn;var er=`MenuSubContent`,tr=X.forwardRef((e,t)=>{let n=mn(gn,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=on(gn,e.__scopeMenu),o=cn(gn,e.__scopeMenu),s=Xn(er,e.__scopeMenu),c=X.useRef(null),l=oe(t,c);return(0,Y.jsx)(Zt.Provider,{scope:e.__scopeMenu,children:(0,Y.jsx)(Ge,{present:r||a.open,children:(0,Y.jsx)(Zt.Slot,{scope:e.__scopeMenu,children:(0,Y.jsx)(Cn,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Ue(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ue(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:Ue(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Yt[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});tr.displayName=er;function nr(e){return e?`open`:`closed`}function rr(e){return e===`indeterminate`}function ir(e){return rr(e)?`indeterminate`:e?`checked`:`unchecked`}function ar(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function or(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sr(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=or(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function cr(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function lr(e,t){return t?cr({x:e.clientX,y:e.clientY},t):!1}function ur(e){return t=>t.pointerType===`mouse`?e(t):void 0}var dr=ln,fr=dn,pr=hn,mr=yn,hr=Tn,gr=Dn,_r=An,vr=Nn,yr=Ln,br=zn,xr=Un,Sr=Gn,Cr=qn,wr=Zn,Tr=$n,Er=tr,Dr=`DropdownMenu`,[Or,kr]=Be(Dr,[tn]),Ar=tn(),[jr,Mr]=Or(Dr),Nr=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Ar(t),l=X.useRef(null),[u,d]=Je({prop:i,defaultProp:a??!1,onChange:o,caller:Dr});return(0,Y.jsx)(jr,{scope:t,triggerId:ze(),triggerRef:l,contentId:ze(),open:u,onOpenChange:d,onOpenToggle:X.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,Y.jsx)(dr,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Nr.displayName=Dr;var Pr=`DropdownMenuTrigger`,Fr=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Mr(Pr,n),o=Ar(n);return(0,Y.jsx)(fr,{asChild:!0,...o,children:(0,Y.jsx)(Ve.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:ae(t,a.triggerRef),onPointerDown:Ue(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Ue(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Fr.displayName=Pr;var Ir=`DropdownMenuPortal`,Lr=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Ar(t);return(0,Y.jsx)(pr,{...r,...n})};Lr.displayName=Ir;var Rr=`DropdownMenuContent`,zr=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Mr(Rr,n),a=Ar(n),o=X.useRef(!1);return(0,Y.jsx)(mr,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ue(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Ue(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});zr.displayName=Rr;var Br=`DropdownMenuGroup`,Vr=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(hr,{...i,...r,ref:t})});Vr.displayName=Br;var Hr=`DropdownMenuLabel`,Ur=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(gr,{...i,...r,ref:t})});Ur.displayName=Hr;var Wr=`DropdownMenuItem`,Gr=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(_r,{...i,...r,ref:t})});Gr.displayName=Wr;var Kr=`DropdownMenuCheckboxItem`,qr=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(vr,{...i,...r,ref:t})});qr.displayName=Kr;var Jr=`DropdownMenuRadioGroup`,Yr=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(yr,{...i,...r,ref:t})});Yr.displayName=Jr;var Xr=`DropdownMenuRadioItem`,Zr=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(br,{...i,...r,ref:t})});Zr.displayName=Xr;var Qr=`DropdownMenuItemIndicator`,$r=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(xr,{...i,...r,ref:t})});$r.displayName=Qr;var ei=`DropdownMenuSeparator`,ti=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(Sr,{...i,...r,ref:t})});ti.displayName=ei;var ni=`DropdownMenuArrow`,ri=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(Cr,{...i,...r,ref:t})});ri.displayName=ni;var ii=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Ar(t),[s,c]=Je({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,Y.jsx)(wr,{...o,open:s,onOpenChange:c,children:n})},ai=`DropdownMenuSubTrigger`,oi=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(Tr,{...i,...r,ref:t})});oi.displayName=ai;var si=`DropdownMenuSubContent`,ci=X.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ar(n);return(0,Y.jsx)(Er,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});ci.displayName=si;var li=Nr,ui=Fr,di=Lr,fi=zr,pi=Vr,mi=Ur,hi=Gr,gi=qr,_i=Yr,vi=Zr,yi=$r,bi=ti,xi=ii,Si=oi,Ci=ci,wi=`Separator`,Ti=`horizontal`,Ei=[`horizontal`,`vertical`],Di=X.forwardRef((e,t)=>{let{decorative:n,orientation:r=Ti,...i}=e,a=Oi(r)?r:Ti,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,Y.jsx)(Ve.div,{"data-orientation":a,...o,...i,ref:t})});Di.displayName=wi;function Oi(e){return Ei.includes(e)}var ki=Di;async function Ai(e){try{await navigator.clipboard.writeText(e)}catch{}}var ji=120*1e3;function Mi(e){let t=(0,Z.c)(25),{onSuccess:n,transport:i}=e,{_:o}=r(),[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)(`https://github.com/login/device`),[d,f]=(0,X.useState)(!1),[p,m]=(0,X.useState)(null),[h,g]=(0,X.useState)(ji),_=(0,X.useRef)(null),v=(0,X.useRef)(null),y;t[0]!==o||t[1]!==n||t[2]!==i?(y=async function(){m(null);try{let e=i.start();_.current=e.cancel;let t=e.events[Symbol.asyncIterator](),r=!1,a=await t.next();for(;!a.done;){let e=a.value;if(e.type===`verification`)c(e.user_code),u(e.verification_uri),g(e.expires_in*1e3),Ai(e.user_code).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)});else if(e.type===`complete`){r=!0,n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){r=!0,m(e.message);break}a=await t.next()}r||m(o({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&m(o({id:`Q5fqMz`}))}},t[0]=o,t[1]=n,t[2]=i,t[3]=y):y=t[3];let b=y,x;t[4]===b?x=t[5]:(x=()=>{let e=!1;return queueMicrotask(()=>{e||b()}),()=>{e=!0,_.current?.(),_.current=null,v.current&&clearInterval(v.current)}},t[4]=b,t[5]=x);let C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[6]=C):C=t[6],(0,X.useEffect)(x,C);let w,T;t[7]!==o||t[8]!==s?(w=()=>{if(!s)return;let e=Date.now();return v.current=setInterval(()=>{let t=ji-(Date.now()-e);t<=0?(g(0),v.current&&clearInterval(v.current),m(o({id:`ve8vEM`}))):g(t)},1e3),()=>{v.current&&clearInterval(v.current)}},T=[s,o],t[7]=o,t[8]=s,t[9]=w,t[10]=T):(w=t[9],T=t[10]),(0,X.useEffect)(w,T);let E=Math.floor(h/6e4),D=Math.floor(h%6e4/1e3),O;t[11]===D?O=t[12]:(O=D.toString().padStart(2,`0`),t[11]=D,t[12]=O);let k=`${E}:${O}`,A;t[13]!==o||t[14]!==d||t[15]!==p||t[16]!==k||t[17]!==s||t[18]!==l?(A=s?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Y.jsx)(a,{id:`eVPynQ`,values:{verificationUri:l},components:{0:(0,Y.jsx)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Ut(e,l),onAuxClick:e=>Ut(e,l),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,Y.jsx)(`span`,{}),2:(0,Y.jsx)(ce,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,Y.jsxs)(q,{type:`button`,variant:`outline`,"aria-label":o({id:`nCzR-G`,values:{userCode:s}}),onClick:()=>void Ai(s).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)}),className:`relative h-auto w-full justify-center rounded-md bg-muted px-12 py-3 hover:bg-muted/80`,children:[(0,Y.jsx)(`code`,{className:`font-mono text-2xl font-bold tracking-widest`,children:s}),(0,Y.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:d?(0,Y.jsx)(xe,{className:`size-4`}):(0,Y.jsx)(S,{className:`size-4`})})]}),(0,Y.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:d?(0,Y.jsx)(a,{id:`80c4-P`}):null}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,Y.jsx)(a,{id:`5y_9lO`})]}),(0,Y.jsx)(`span`,{children:(0,Y.jsx)(a,{id:`gYz2ep`,values:{timeLabel:k}})})]})]}):(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:p?null:(0,Y.jsx)(a,{id:`aWlJai`})}),t[13]=o,t[14]=d,t[15]=p,t[16]=k,t[17]=s,t[18]=l,t[19]=A):A=t[19];let j;t[20]===p?j=t[21]:(j=p&&(0,Y.jsx)(`p`,{className:`text-1sm text-destructive`,children:p}),t[20]=p,t[21]=j);let M;return t[22]!==A||t[23]!==j?(M=(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[A,j]}),t[22]=A,t[23]=j,t[24]=M):M=t[24],M}function Ni(e){let t=(0,Z.c)(30),{login:n,name:i,onNameChange:o,email:s,onEmailChange:c}=e,{_:l}=r(),u;t[0]===n?u=t[1]:(u=(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:(0,Y.jsx)(a,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,Y.jsx)(a,{id:`gp3I7-`})}),t[2]=d):d=t[2];let f;t[3]===l?f=t[4]:(f=l({id:`6YtxFj`}),t[3]=l,t[4]=f);let p;t[5]!==l||t[6]!==n?(p=l({id:`J2Mv98`,values:{login:n}}),t[5]=l,t[6]=n,t[7]=p):p=t[7];let m;t[8]===o?m=t[9]:(m=e=>o(e.target.value),t[8]=o,t[9]=m);let h;t[10]!==i||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,Y.jsx)(Se,{"aria-label":f,placeholder:p,value:i,onChange:m}),t[10]=i,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===l?g=t[16]:(g=l({id:`O3oNi5`}),t[15]=l,t[16]=g);let _;t[17]===l?_=t[18]:(_=l({id:`O3oNi5`}),t[17]=l,t[18]=_);let v;t[19]===c?v=t[20]:(v=e=>c(e.target.value),t[19]=c,t[20]=v);let y;t[21]!==s||t[22]!==g||t[23]!==_||t[24]!==v?(y=(0,Y.jsx)(Se,{type:`email`,"aria-label":g,placeholder:_,value:s,onChange:v}),t[21]=s,t[22]=g,t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==u||t[27]!==y||t[28]!==h?(b=(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[u,d,h,y]}),t[26]=u,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}var Pi=1e4;function Fi(e){let t=(0,Z.c)(59),{open:n,onOpenChange:i,onSuccess:o,identityPrompt:s,reauth:c,transport:l,queryTransport:u}=e,{_:d}=r(),f;t[0]===l?f=t[1]:(f=l??Vt(),t[0]=l,t[1]=f);let p=f,m;t[2]===u?m=t[3]:(m=u??Lt(),t[2]=u,t[3]=m);let h=m,[g,_]=(0,X.useState)(`auth`),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(``),[S,C]=(0,X.useState)(``),w,T;t[4]!==s||t[5]!==n?(w=()=>{n&&(y(null),x(``),C(``),_(s?`checking`:`auth`))},T=[n,s],t[4]=s,t[5]=n,t[6]=w,t[7]=T):(w=t[6],T=t[7]),(0,X.useLayoutEffect)(w,T);let E;t[8]!==s||t[9]!==n||t[10]!==h?(E=()=>{if(!n||!s)return;let e=!1,t=t=>{e||(e=!0,_(t))},r=setTimeout(()=>t(`auth`),Pi);return h.status().then(n=>{e||(n.authenticated?(y({login:n.login,name:n.name,email:n.email}),x(n.name??``),C(n.email??``),t(`identity`)):t(`auth`))}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[8]=s,t[9]=n,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==s||t[13]!==n?(D=[n,s],t[12]=s,t[13]=n,t[14]=D):D=t[14],(0,X.useEffect)(E,D);let O;t[15]!==d||t[16]!==s||t[17]!==i||t[18]!==o?(O=function(e){if(y(e),s)x(e.name??``),C(e.email??``),_(`identity`);else{_(`done`),o?.(e),i(!1);let t=e.login;Ie.success(d({id:`E_tNGD`,values:{login:t}}))}},t[15]=d,t[16]=s,t[17]=i,t[18]=o,t[19]=O):O=t[19];let k=O,A;t[20]!==d||t[21]!==v||t[22]!==i||t[23]!==o?(A=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(Ii);let n={...v??{login:``},name:e,email:t};_(`done`),o?.(n),i(!1);let r=n.login;Ie.success(d({id:`E_tNGD`,values:{login:r}}))},t[20]=d,t[21]=v,t[22]=i,t[23]=o,t[24]=A):A=t[24];let j=A,M;t[25]!==d||t[26]!==v||t[27]!==i||t[28]!==o?(M=function(){if(!v)return;_(`done`),o?.(v),i(!1);let e=v.login;Ie.success(d({id:`E_tNGD`,values:{login:e}}))},t[25]=d,t[26]=v,t[27]=i,t[28]=o,t[29]=M):M=t[29];let N=M,P;t[30]===i?P=t[31]:(P=function(){i(!1)},t[30]=i,t[31]=P);let F=P,I;t[32]!==s||t[33]!==c||t[34]!==g?(I=(0,Y.jsx)(ye,{children:(0,Y.jsx)(de,{children:c?(0,Y.jsx)(a,{id:`X8kjQX`}):s&&g!==`auth`?(0,Y.jsx)(a,{id:`29XZXN`}):(0,Y.jsx)(a,{id:`3jod3l`})})}),t[32]=s,t[33]=c,t[34]=g,t[35]=I):I=t[35];let L;t[36]===g?L=t[37]:(L=g===`checking`&&(0,Y.jsx)(ge,{children:(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,Y.jsx)(a,{id:`gBbxn_`})})}),t[36]=g,t[37]=L);let R;t[38]!==k||t[39]!==F||t[40]!==p||t[41]!==g?(R=g===`auth`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ge,{children:(0,Y.jsx)(Mi,{onSuccess:k,transport:p})}),(0,Y.jsx)(_e,{children:(0,Y.jsx)(q,{variant:`outline`,className:`font-mono uppercase`,onClick:F,children:(0,Y.jsx)(a,{id:`dEgA5A`})})})]}),t[38]=k,t[39]=F,t[40]=p,t[41]=g,t[42]=R):R=t[42];let z;t[43]!==v||t[44]!==j||t[45]!==N||t[46]!==S||t[47]!==b||t[48]!==g?(z=g===`identity`&&v&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ge,{children:(0,Y.jsx)(Ni,{login:v.login,name:b,onNameChange:x,email:S,onEmailChange:C})}),(0,Y.jsxs)(_e,{children:[(0,Y.jsx)(q,{variant:`ghost`,onClick:N,children:(0,Y.jsx)(a,{id:`6Uau97`})}),(0,Y.jsx)(q,{onClick:()=>j(b.trim(),S.trim()),disabled:!b.trim()||!S.trim(),children:(0,Y.jsx)(a,{id:`tfDRzk`})})]})]}),t[43]=v,t[44]=j,t[45]=N,t[46]=S,t[47]=b,t[48]=g,t[49]=z):z=t[49];let B;t[50]!==I||t[51]!==L||t[52]!==R||t[53]!==z?(B=(0,Y.jsxs)(me,{className:`sm:max-w-md`,children:[I,L,R,z]}),t[50]=I,t[51]=L,t[52]=R,t[53]=z,t[54]=B):B=t[54];let V;return t[55]!==i||t[56]!==n||t[57]!==B?(V=(0,Y.jsx)(be,{open:n,onOpenChange:i,children:B}),t[55]=i,t[56]=n,t[57]=B,t[58]=V):V=t[58],V}function Ii(){}var Li=null;function Ri(){return Li}function zi(e){Li=e}function Bi(e){let t=(0,Z.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=K(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vi(e){let t=(0,Z.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,X.useState)(n),[a,o]=(0,X.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return Fe(()=>{o(Gi)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,X.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(Ui).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:`Server returned an incomplete folder response.`});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,X.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(Hi),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function Hi(e){return e+1}async function Ui(e){if(!e.ok){let t=await e.json().catch(Wi);throw Error(je(t)??`HTTP ${e.status}`)}return e.json()}function Wi(){return null}function Gi(e){return e+1}function Ki(e,t){let n=(0,Z.c)(5),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},n[0]=r):r=n[0];let[i,a]=(0,X.useState)(r),o,s;return n[1]!==e||n[2]!==t?(o=()=>{if(!t||e===null){a({status:`idle`});return}let n=!1;a({status:`loading`});let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`;return fetch(`/api/template${r}`).then(qi).then(e=>{if(!n){if(!e||typeof e!=`object`||!e.template){a({status:`error`,message:`Server returned an incomplete template response.`});return}a({status:`ready`,data:e.template})}}).catch(e=>{n||a({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{n=!0}},s=[e,t],n[1]=e,n[2]=t,n[3]=o,n[4]=s):(o=n[3],s=n[4]),(0,X.useEffect)(o,s),i}async function qi(e){if(!e.ok){let t=await e.json().catch(Ji);throw Error(je(t)??`HTTP ${e.status}`)}return e.json()}function Ji(){return null}function Yi(){let e=(0,Z.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,X.useState)(t),[i,a]=(0,X.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>Fe(()=>{a(Qi)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,X.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then(Xi).then(t=>{if(e)return;let n=z.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:`Server returned an incomplete templates response.`});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,X.useEffect)(c,l),n}async function Xi(e){if(!e.ok){let t=await e.json().catch(Zi);throw Error(je(t)??`HTTP ${e.status}`)}return e.json()}function Zi(){return null}function Qi(e){return e+1}function $i(e){let t=(0,Z.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,orientation:i,decorative:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`horizontal`:i,s=a===void 0?!0:a,c;t[5]===n?c=t[6]:(c=K(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==o||t[9]!==r||t[10]!==c?(l=(0,Y.jsx)(ki,{"data-slot":`separator`,decorative:s,orientation:o,className:c,...r}),t[7]=s,t[8]=o,t[9]=r,t[10]=c,t[11]=l):l=t[11],l}function ea(e){let t=(0,Z.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=K(`group/field-group @container/field-group flex w-full flex-col gap-6 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`field-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var ta=te(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function na(e){let t=(0,Z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]!==n||t[5]!==a?(o=K(ta({orientation:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Y.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":a,className:o,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function ra(e){let t=(0,Z.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=K(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`field-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ia(e){let t=(0,Z.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=K(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(at,{"data-slot":`field-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function aa(e){let t=(0,Z.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=K(`flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`field-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function oa(e){let t=(0,Z.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=K(`text-left text-1sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`p`,{"data-slot":`field-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sa(e){let t=(0,Z.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,errors:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;bb0:{if(n){o=n;break bb0}if(!i?.length){o=null;break bb0}let e;t[5]===i?e=t[6]:(e=[...new Map(i.map(la)).values()],t[5]=i,t[6]=e);let r=e;if(r?.length===1){o=r[0]?.message;break bb0}let a;t[7]===r?a=t[8]:(a=(0,Y.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(ca)}),t[7]=r,t[8]=a),o=a}let s=o;if(!s)return null;let c;t[9]===r?c=t[10]:(c=K(`text-sm font-normal text-destructive`,r),t[9]=r,t[10]=c);let l;return t[11]!==s||t[12]!==a||t[13]!==c?(l=(0,Y.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:c,...a,children:s}),t[11]=s,t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function ca(e){return e?.message&&(0,Y.jsx)(`li`,{children:e.message},e.message)}function la(e){return[e?.message,e]}async function ua(){try{let e=await fetch(`/api/semantic-status`);return e.ok?await e.json():(console.debug(`[semantic-status] probe returned`,e.status),null)}catch(e){return console.debug(`[semantic-status] probe failed`,e),null}}function da(e){let t=(0,Z.c)(16),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n.enabled??!0,[i,a]=(0,X.useState)(null),o;t[2]===r?o=t[3]:(o=function(){r&&ua().then(e=>{e&&a(e)})},t[2]=r,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=()=>{s()},t[4]=s,t[5]=c);let l;t[6]===r?l=t[7]:(l=[r],t[6]=r,t[7]=l),(0,X.useEffect)(c,l);let u;t[8]!==r||t[9]!==s?(u=()=>{if(r)return Me(e=>{e.includes(`files`)&&s()})},t[8]=r,t[9]=s,t[10]=u):u=t[10];let d;t[11]===r?d=t[12]:(d=[r],t[11]=r,t[12]=d),(0,X.useEffect)(u,d);let f;return t[13]!==s||t[14]!==i?(f={status:i,refresh:s},t[13]=s,t[14]=i,t[15]=f):f=t[15],f}function fa(){let e=(0,Z.c)(3),[t,n]=(0,X.useState)(ha),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(ma);if(!e||!t.ok)return;let i=j.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(pa),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,X.useEffect)(r,i),t}function pa(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function ma(){return null}function ha(){return ga()}function ga(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}async function _a(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function va(){return ya().status}function ya(){let e=(0,Z.c)(8),[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){_a().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,X.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>Me(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,X.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var ba=`open-knowledge-app`;function xa(e){try{Re.getTracer(ba).startSpan(e).end()}catch(e){console.warn(`[terminal-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function Sa(){xa(`ok.desktop.terminalOpened`)}function Ca(){xa(`ok.desktop.shellConsentGranted`)}function wa(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(de,{children:(0,Y.jsx)(a,{id:`q_9EcE`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsxs)(Y.Fragment,{children:[t,(0,Y.jsx)(ue,{children:(0,Y.jsx)(a,{id:`n6hXUm`})})]}),e[1]=n):n=e[1],n}function Ta(){let e=(0,Z.c)(10),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-semibold font-mono uppercase tracking-wider text-primary`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,Y.jsx)(a,{id:`6s7LXO`})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(pt,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`p`,{className:`font-medium`,children:(0,Y.jsx)(a,{id:`cdmk8A`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,(0,Y.jsxs)(`div`,{className:`space-y-0.5`,children:[r,(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:(0,Y.jsx)(a,{id:`YaeyFh`})})]})]}),e[3]=i):i=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Ct,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[4]=o):o=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`p`,{className:`font-medium`,children:(0,Y.jsx)(a,{id:`9i21pa`})}),e[5]=s):s=e[5];let c;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,(0,Y.jsxs)(`div`,{className:`space-y-0.5`,children:[s,(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:(0,Y.jsx)(a,{id:`qvcK7S`})})]})]}),e[6]=c):c=e[6];let l;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(O,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[7]=l):l=e[7];let u;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(`p`,{className:`font-medium`,children:(0,Y.jsx)(a,{id:`8cpeU3`})}),e[8]=u):u=e[8];let d;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsxs)(`div`,{role:`note`,className:`text-sm space-y-5`,children:[t,(0,Y.jsxs)(`div`,{className:`space-y-5`,children:[i,c,(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l,(0,Y.jsxs)(`div`,{className:`space-y-0.5`,children:[u,(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:(0,Y.jsx)(a,{id:`DELNQk`})})]})]})]})]}),e[9]=d):d=e[9],d}function Ea(){let e=(0,Z.c)(2),{projectLocalBinding:t}=p();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{enabled:e}});return n.ok?{ok:!0}:{ok:!1,error:W(n.error)}},e[0]=t,e[1]=n),n}function Da(e){let t=(0,Z.c)(11),{_:n}=r(),[i,a]=(0,X.useState)(!1),o;t[0]!==n||t[1]!==e?(o=function(t){if(e===null)return Ie.error(n({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] toggle failed:`,r.error);let e=r.error;return Ie.error(n(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},t[0]=n,t[1]=e,t[2]=o):o=t[2];let s=o,c;t[3]===s?c=t[4]:(c=function(e){if(e){a(!0);return}s(!1)},t[3]=s,t[4]=c);let l=c,u;t[5]===s?u=t[6]:(u=function(){s(!0)&&a(!1)},t[5]=s,t[6]=u);let d=u,f;return t[7]!==i||t[8]!==d||t[9]!==l?(f={confirmOpen:i,setConfirmOpen:a,onToggleRequest:l,onConfirm:d},t[7]=i,t[8]=d,t[9]=l,t[10]=f):f=t[10],f}function Oa(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function ka(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 Aa(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(ka(e))return;throw t}if(!ka(e))throw Error(`clipboard API unavailable`)}function ja(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(li,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function Ma(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(ui,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Na(e){let t=(0,Z.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`start`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=K(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,Y.jsx)(di,{children:(0,Y.jsx)(fi,{"data-slot":`dropdown-menu-content`,sideOffset:s,align:o,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Pa(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(pi,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function Fa(e){let t=(0,Z.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=K(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Y.jsx)(hi,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Ia(e){let t=(0,Z.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=K(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,Y.jsx)(yi,{children:(0,Y.jsx)(xe,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Y.jsxs)(gi,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function La(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(_i,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function Ra(e){let t=(0,Z.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,inset:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=K(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,Y.jsx)(yi,{children:(0,Y.jsx)(xe,{})})}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Y.jsxs)(vi,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:o,...a,children:[s,n]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function za(e){let t=(0,Z.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=K(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Y.jsx)(mi,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Ba(e){let t=(0,Z.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=K(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(bi,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Va(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(xi,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function Ha(e){let t=(0,Z.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=K(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(we,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Y.jsxs)(Si,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Ua(e){let t=(0,Z.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=K(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Ci,{"data-slot":`dropdown-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wa(){var e=[...arguments];return(0,X.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var Ga=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ka(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function qa(e){return`nodeType`in e}function Ja(e){return e?Ka(e)?e:qa(e)?e.ownerDocument?.defaultView??window:window:window}function Ya(e){let{Document:t}=Ja(e);return e instanceof t}function Xa(e){return Ka(e)?!1:e instanceof Ja(e).HTMLElement}function Za(e){return e instanceof Ja(e).SVGElement}function Qa(e){return e?Ka(e)?e.document:qa(e)?Ya(e)?e:Xa(e)||Za(e)?e.ownerDocument:document:document:document}var $a=Ga?X.useLayoutEffect:X.useEffect;function eo(e){let t=(0,X.useRef)(e);return $a(()=>{t.current=e}),(0,X.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function to(){let e=(0,X.useRef)(null);return[(0,X.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,X.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function no(e,t){t===void 0&&(t=[e]);let n=(0,X.useRef)(e);return $a(()=>{n.current!==e&&(n.current=e)},t),n}function ro(e,t){let n=(0,X.useRef)();return(0,X.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function io(e){let t=eo(e),n=(0,X.useRef)(null);return[n,(0,X.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function ao(e){let t=(0,X.useRef)();return(0,X.useEffect)(()=>{t.current=e},[e]),t.current}var oo={};function so(e,t){return(0,X.useMemo)(()=>{if(t)return t;let n=oo[e]==null?0:oo[e]+1;return oo[e]=n,e+`-`+n},[e,t])}function co(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var lo=co(1),uo=co(-1);function fo(e){return`clientX`in e&&`clientY`in e}function po(e){if(!e)return!1;let{KeyboardEvent:t}=Ja(e.target);return t&&e instanceof t}function mo(e){if(!e)return!1;let{TouchEvent:t}=Ja(e.target);return t&&e instanceof t}function ho(e){if(mo(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return fo(e)?{x:e.clientX,y:e.clientY}:null}var go=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[go.Translate.toString(e),go.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),_o=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function vo(e){return e.matches(_o)?e:e.querySelector(_o)}var yo={display:`none`};function bo(e){let{id:t,value:n}=e;return X.createElement(`div`,{id:t,style:yo},n)}function xo(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return X.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function So(){let[e,t]=(0,X.useState)(``);return{announce:(0,X.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Co=(0,X.createContext)(null);function wo(e){let t=(0,X.useContext)(Co);(0,X.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function To(){let[e]=(0,X.useState)(()=>new Set),t=(0,X.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,X.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Eo={draggable:`
4
4
  To pick up a draggable item, press the space bar.
@@ -508,4 +508,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
508
508
  `:`
509
509
  `;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length),p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
510
510
  `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=G7(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:nne({...i,attributes:(i.attributes??[]).map(ine)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=G7(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=s?.[c++];return r===`none`||r===0?`>${e}`:typeof r==`number`&&r>=2&&!e.startsWith(` `)?`>${` `.repeat(r)}${e}`:`> ${e}`})}};function G7(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${K7(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function K7(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function ine(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:K7(e.value)}}:e}function q7(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function J7(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function ane(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>one(t)?e:`\\${e}`)}function one(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32}function Y7(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return ane(une(i,n))}var X7=1,sne=2;function Z7(e){if(Number.isNaN(e))return`ws`;let t=sz(e);return t===X7?`ws`:t===sne?`punct`:`other`}function cne(e,t,n){let r=Z7(t),i=Z7(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function lne(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
511
- `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function une(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&lne(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=cne(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Q7(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=e,a=i.charCodeAt(0);$7(t.before.charCodeAt(t.before.length-1),a,r)&&(i=e9(a)+i.slice(1));let o=i.charCodeAt(i.length-1);return $7(t.after.charCodeAt(0),o,r)&&(i=i.slice(0,-1)+e9(o)),i}function $7(e,t,n){return!(sz(t)!==X7||n===`_`&&sz(e)===void 0)}function e9(e){return`&#x${e.toString(16).toUpperCase()};`}function dne(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!pne(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function fne(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),s+=a.move(i),o(),s}function pne(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function t9(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var mne=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Tb(e.extensions),this.handlers=bne(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=xne(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Gte({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=Kte({toMarkdownHandlers:rne})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return Jte(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Yte(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?X6(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return Xte(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},n9=D6();function hne(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function gne(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function _ne(e){return e.attrs.sourceDirty||gne(e)}function vne(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function r9(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function i9(e,t){if(e.length===0)return r9({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return r9({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[i9(n.children,t)]}}return r9({type:`inlineCode`,value:a9(e)},t)}function a9(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=a9(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var yne=V1;function bne(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=XU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=XU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=W7(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&r2(t.raw)!==null&&e2(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=r2(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=ZU(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=ZU(r.highlight)),r.comment&&(i.comment=ZU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=XU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=ZU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=ZU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=XU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=XU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=XU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=n9.getOrWildcard(o),c=hne(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=W7(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=b2(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&yne.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&H1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&W1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&G1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:t9(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=XU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function xne(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=nW(`paragraph`)),r.blockquote&&(t.blockquote=nW(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=nW(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=nW(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&vne(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),r.tableRow&&(t.tableRow=nW(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=nW(`tableCell`,a)),r.tableHeader&&(t.tableHeader=nW(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!_ne(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:n9.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:n9,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=rW(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=rW(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return i9(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=rW(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return i.highlight&&(n.highlight=rW(`mark`)),i.comment&&(n.comment=rW(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=nW(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=nW(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return a2(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var Sne=/\p{M}+/gu,Cne=/[^\p{L}\p{N}]+/gu,wne=/^-+|-+$/g;function o9(e){return e.trim().normalize(`NFKD`).replace(Sne,``).toLowerCase().replace(Cne,`-`).replace(wne,``)}function Tne(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function Ene(e,t){let n=o9(e);return n?Tne(n,t):``}function s9(e,t){let n=o9(e);return t?`#${n}-${o9(t)}`:`#${n}`}var c9=new Set([`img`,`video`,`audio`,`mark`]),Dne=new Map(T6.flatMap(e=>e.surface===`compat`&&c9.has(e.rendersAs)?[[e.name,e]]:[]));function l9(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function u9(e){let t=e.name;if(!t||!c9.has(t))return null;let n=l9(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function d9(e){let t=e.name;if(!t)return null;let n=Dne.get(t);if(!n)return null;let r=l9(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var One=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},kne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Ane=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},jne=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Mne=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Nne=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function f9(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(f9).join(``):``}var p9={wikiLink:One,wikiLinkEmbed:kne,mdxJsxFlowElement:Ane,mdxJsxTextElement:jne,rawMdxFallback:Mne,mark:Nne,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Pne=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Fne=/\bexpression\s*\(/i,Ine=1e4;function Lne(e){return!(e.length>Ine||Pne.test(e)||Fne.test(e))}function m9(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!k0(e.split(/\s+/)[0]??``))return!1}return!0}var Rne={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},zne=new Set([`href`,`src`]),Bne=cV(`<>`),h9=()=>e=>{IF(e,`element`,e=>{let t=Rne[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?U8(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(zne.has(e))if(t===`<>`||t===Bne)r=``;else{let e=U8(t);r=e===t?t:cV(e)}else r=U8(t);r!==t&&(n[e]=r)}})},g9=()=>e=>{IF(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!k0(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!k0(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!k0(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!m9(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!m9(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!k0(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Lne(r)&&delete n.style})};function Vne(e){let t=DU().use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ),n=t.runSync(e);return String(t.stringify(n))}function _9(e){let t=DU().use(TG).use(wW,[`yaml`]).use(w7).use(vU).use(R7).use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ);return String(t.processSync(e))}fq(),TK(),EK(),A({docName:d4,summary:p4,content:E().optional(),...f4}).loose(),A({docName:d4,summary:p4,markdown:E(),position:j([`append`,`prepend`,`replace`]).optional(),extension:j(T1).optional(),...f4}).loose(),A({docName:d4,summary:p4,find:E().min(1),replace:E(),offset:D().int().nonnegative().optional(),...f4}).loose(),A({docName:d4,connectionId:E().min(1),scope:j([`last`,`session`,`file`]).optional(),...f4}).loose();var v9=A({value:E(),truncatedFrom:D().int().nonnegative().optional(),hint:E().optional()}).loose(),Hne=Ua(`kind`,[A({kind:M(`inline`),content:E()}),A({kind:M(`truncated`),byteLength:D().int().nonnegative(),hint:E()})]),y9=A({kind:M(`content-divergence`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),divergenceType:E().optional(),currentState:Hne.optional(),hint:E().optional()}).loose(),Une=A({type:M(`orphan`),parentCandidates:k(E()),message:E()}).loose(),b9=A({kind:M(`disk-edit-reconciled`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),mergeOutcome:E().optional(),hint:E().optional()}).loose(),x9=Ua(`kind`,[y9,b9]),S9=k(Ua(`kind`,[y9,b9,A({kind:M(`mermaid-parse-error`),fenceIndex:D().int().positive(),fenceFirstLine:E(),message:E(),line:D().int().positive().optional()}).loose()])).min(1);A({timestamp:E().min(1),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),hints:k(Une).optional(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({docName:E().min(1),scope:j([`last`,`session`]),undone:O()}).loose(),A({docName:d4,patch:qa(E(),Va([WQ,Ma()])),types:qa(E(),j(VQ)).optional(),summary:p4,...f4}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),appliedKeys:k(E()),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({entries:k(A({level:j([`info`,`warn`,`error`]),message:E().max(N4),event:E().optional(),fields:qa(E(),Pa()).optional(),ts:D().optional(),sourceId:E().optional(),lineNumber:D().optional()}).loose()).max(100)}).loose(),A({accepted:D().int().min(0)}).loose();var Wne=A({status:E().min(1),reason:E()}).loose();A({docName:E().min(1),content:E(),lifecycle:Wne.nullable()}).loose();var C9=A({kind:j([`document`,`asset`,`folder`,`file`]).default(`document`),docName:E().min(1).optional(),docExt:E().min(1).default(`.md`),size:D().int().nonnegative(),modified:E().min(1),isSymlink:O().default(!1),canonicalDocName:E().nullable().default(null),targetPath:E().nullable().default(null),path:E().min(1).optional(),assetExt:E().min(1).optional(),mediaKind:j([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:k(E().min(1)).optional(),hasChildren:O().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Gne=A({documents:k(C9),truncated:O().optional()}).loose(),Kne=A({source:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),qne=A({docName:E().min(1),backlinks:k(Kne)}).loose();A({counts:qa(E().min(1),D().int().nonnegative())}).loose();var Jne=Ua(`kind`,[A({kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),A({kind:M(`external`),url:E().min(1),title:E(),snippet:E().nullable()}).loose()]),Yne=A({docName:E().min(1),forwardLinks:k(Jne)}).loose(),Xne=Ua(`kind`,[A({id:E().min(1),kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),label:E(),cluster:E().nullable(),category:E().nullable(),tags:k(E()).nullable()}).loose(),A({id:E().min(1),kind:M(`external`),url:E().min(1),label:E()}).loose()]),Zne=A({source:E().min(1),target:E().min(1)}).loose(),Qne=A({nodes:k(Xne),links:k(Zne)}).loose(),$ne=A({ts:D().int().min(0),url:E(),method:E(),ua:E().optional(),origin:E().optional(),referer:E().optional(),host:E().optional(),remote:E().optional(),secChUa:E().optional(),secChUaMobile:E().optional(),secChUaPlatform:E().optional(),secFetchSite:E().optional(),secFetchDest:E().optional(),secFetchMode:E().optional(),secFetchUser:E().optional()}).loose(),ere=A({app:Va([M(`cursor`),M(`codex`),M(`claude`),Ma()]),signals_fired:k(E())}).loose();A({entries:k($ne),count:D().int().min(0),detection:ere}).loose(),A({writers:k(A({id:E().min(1),name:E().optional(),email:E().optional()}).loose()).optional(),summary:p4,...f4}).loose(),A({checkpointRef:E().min(1)}).loose();var tre=A({v:D().int().optional(),id:E().min(1),name:E().min(1),colorSeed:E().optional(),docs:k(E()),summaries:k(E()).optional()}).loose();A({entries:k(A({sha:E().min(1),timestamp:E().min(1),author:E(),authorEmail:E(),type:j([`checkpoint`,`wip`,`upstream`,`park`]),message:E(),contributors:k(tre),checkpoint:Pa().nullable()}).loose()),total:D().int().nonnegative().optional(),truncated:O().optional(),hasMore:O().optional()}).loose(),A({sha:E().regex(/^[0-9a-f]{40}$/i),content:E(),timestamp:E(),author:E()}).loose();var nre=A({contentDir:E().min(1),pathSeparator:j([`/`,`\\`]),symlinkResolved:O()}).loose();k(Ua(`source`,[A({docName:E().min(1),timestamp:E().min(1),size:D().int().nonnegative(),source:M(`flat`)}).loose(),A({docName:E().min(1),timestamp:E().min(1),source:M(`timeline`),sha:E().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var rre=A({orphans:k(A({docName:E().min(1),title:E()}).loose())}).loose(),ire=A({hubs:k(A({docName:E().min(1),title:E(),count:D().int().nonnegative()}).loose())}).loose(),are=A({source:E().min(1),title:E(),snippet:E().nullable()}).loose();A({deadLinks:k(A({target:E().min(1),sources:k(are)}).loose())}).loose(),A({target:A({docName:E().min(1),title:E(),aliases:k(E())}).loose(),mentions:k(A({source:E().min(1),excerpt:E(),offset:D().int().nonnegative()}).loose()),truncated:O()}).loose(),A({projectPath:E().min(1)}).loose();var ore=j([`not-a-git-worktree`,`init-failed`]);Ua(`ok`,[A({ok:M(!0),projectPath:E().min(1)}).loose(),A({ok:M(!1),reason:ore,message:E().min(1)}).loose()]),A({host:E().min(1).optional()}).loose(),A({key:E().min(1)}).loose(),A({keyPresent:O()}).loose(),A({name:E().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:E().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),A({authenticated:O()}).loose(),A({}).loose();var sre=A({stackIndex:D().int().min(0),ts:D().int().min(0),additions:D().int().min(0),deletions:D().int().min(0)}).loose(),cre=A({docName:E().min(1),additionsTotal:D().int().min(0),deletionsTotal:D().int().min(0),lastTs:D().int().min(0),bursts:k(sre)}).loose(),lre=A({displayName:E().min(1),color:E().min(1),icon:E().optional(),connectionId:E().min(1)}).loose(),ure=A({sessionAlive:O(),agent:lre.nullable(),files:k(cre)}).loose(),dre=A({diff:E(),generatedAt:D().int().min(0)}).loose();A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose();var fre=A({displayName:E().min(1),icon:E(),color:E().min(1),currentDoc:E().nullable(),mode:j([`idle`,`writing`]),ts:D().int().min(0)}).loose();A({presence:qa(E().min(1),fre)}).loose(),qa(E().min(1),O()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),A({path:E().min(1,`path must be non-empty`)}).loose(),A({}).loose();var pre=A({fromDocName:E().min(1),toDocName:E().min(1)}).loose(),mre=A({fromPath:E().min(1),toPath:E().min(1)}).loose();A({}).loose(),A({path:E().min(1),...f4,summary:p4}).loose();var hre=A({docName:E().min(1)}).loose();A({path:E().min(1),...f4,summary:p4}).loose();var gre=A({path:E().min(1)}).loose();A({kind:j([`file`,`folder`]),path:E().min(1),...f4,summary:p4}).loose();var _re=A({kind:j([`file`,`folder`]),path:E().min(1),duplicatedDocNames:k(E().min(1))}).loose(),vre=A({pages:k(A({docName:E().min(1),title:E(),docExt:E().min(1),size:D().int().nonnegative(),modified:E().min(1),icon:E().min(1).max(2048).optional()}).loose())}).loose(),yre=A({level:D().int().min(1).max(6),text:E(),slug:E()}).loose(),bre=A({docName:E().min(1),headings:k(yre)}).loose(),xre=A({docName:E().min(1),rewrites:D().int().nonnegative()}).loose();A({kind:j([`file`,`folder`,`asset`]),fromPath:E().min(1),toPath:E().min(1),...f4,summary:p4}).loose();var Sre=A({renamed:k(pre),renamedAssets:k(mre),rewrittenDocs:k(xre).optional(),summary:v9.optional()}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4}).loose();var Cre=A({deletedDocNames:k(E().min(1))}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4,summary:p4}).loose();var wre=A({deletedDocNames:k(E().min(1))}).loose();A({docName:E().min(1),commitSha:E().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:p4,...f4}).loose(),A({restoredFrom:E().min(1),timestamp:E().min(1),summary:v9.optional(),warning:y9.optional(),warnings:S9.optional()}).loose();var Tre=j([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Ere=A({label:E().min(1),webUrl:da().nullable()}).loose(),Dre=Ua(`checkStatus`,[A({checkStatus:M(`allowed`)}).loose(),A({checkStatus:M(`denied`),deniedReason:j([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),A({checkStatus:M(`unknown`),unknownError:j([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),w9=j([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);A({state:Tre,lastSyncUtc:E().nullable(),lastFetchUtc:E().nullable(),lastPushedSha:E().nullable(),ahead:D().int().min(0),behind:D().int().min(0),consecutiveFailures:D().int().min(0),conflictCount:D().int().min(0),hasRemote:O(),syncEnabled:O(),identityUnresolved:O(),remote:Ere.nullable().optional(),pushError:E().optional(),pushErrorCode:w9.optional(),pullError:E().optional(),pullErrorCode:w9.optional(),pausedReason:E().optional(),pushPermission:Dre.optional()}).loose(),A({op:j([`sync`,`push`,`pull`]).optional()}).loose(),A({op:j([`sync`,`push`,`pull`])}).loose(),A({conflicts:k(A({file:E().min(1),detectedAt:E().min(1),oursSha:E().optional(),theirsSha:E().optional(),baseSha:E().optional()}).loose())}).loose(),A({file:E().min(1),strategy:j([`mine`,`theirs`,`content`,`delete`]),content:E().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),A({}).loose(),A({file:E().min(1),base:E(),ours:E(),theirs:E(),kind:j([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:E().nullable()}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({result:go(e=>e!==void 0,{message:`result is required`})}).loose();var Ore=A({path:E().min(1),summary:E().min(1)}).loose(),kre=A({files:D().int().nonnegative(),folders:D().int().nonnegative()}).loose();A({packs:k(A({id:E().min(1),name:E().min(1),description:E().min(1),defaultSubfolder:E().optional(),folders:k(Ore),entryCounts:kre}).loose())}).loose(),A({noOpen:O().optional(),out:E().min(1).optional()}).loose();var Are=A({reason:j([`unsupported-platform`,`spawn-error`]),message:E()}).loose();Ua(`status`,[A({status:M(`installed`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E()}).loose(),A({status:M(`built`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E(),handoffError:Are.optional()}).loose(),A({status:M(`failed`),buildError:E()}).loose(),A({status:M(`skip-current`),skillVersion:E(),recordedAt:E().optional()}).loose()]),A({tags:k(A({name:E().min(1),count:D().int().nonnegative(),isLeaf:O()}).loose())}).loose();var jre=A({docName:E().min(1),title:E(),matchingTags:k(E().min(1)),snippet:E().nullable()}).loose();A({name:E().min(1),docs:k(jre)}).loose(),A({folder:Pa(),frontmatter_local:qa(E(),Pa()).nullable()}).loose(),A({path:E(),frontmatter:qa(E(),Pa()).optional()}).loose(),A({applied:Pa()}).loose();var T9=qa(E(),Pa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});A({template:A({name:E().min(1),folder:E(),scope:j([`local`,`inherited`]),path:E().min(1),frontmatter:T9,body:E()}).strict()}).strict();var Mre=A({templates:k(A({name:E().min(1),title:E().optional(),description:E().optional(),path:E().min(1),source_folder:E()}).strict()),truncated:O()}).strict();A({folder:E(),name:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({path:E().min(1),created:O(),warnings:k(E())}).strict(),A({existed:O(),path:E().min(1)}).strict(),A({fromFolder:E(),fromName:E(),toFolder:E(),toName:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({from:E().min(1),to:E().min(1),committed:O()}).strict(),A({query:E().optional(),intent:j([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:j([`navigation`,`relevance`]).optional(),scopes:k(j([`page`,`folder`,`content`,`file`])).optional(),scope:E().optional(),limit:D().int().nonnegative().optional(),semantic:O().optional(),source:j([`omnibar`,`mcp`,`http`]).optional()}).loose();var Nre=A({kind:j([`page`,`folder`,`content`,`file`]),path:E().min(1),title:E(),score:D(),signals:qa(E(),Pa()),snippet:E().optional()}).loose(),Pre=A({capable:O(),applied:O(),coverage:A({embedded:D().int().nonnegative(),total:D().int().nonnegative()})}).loose();A({enabled:O(),keyPresent:O(),keySource:j([`file`,`env`]).nullable(),keyHint:E().nullable(),ready:O(),capable:O(),embedded:D().int().nonnegative(),total:D().int().nonnegative()}).loose(),A({query:E(),intent:j([`autocomplete`,`full_text`,`omnibar`]),results:k(Nre),elapsedMs:D().nonnegative(),semantic:Pre.optional(),truncated:O().optional()}).loose();var Fre=A({version:E().min(1),recordedAt:E().min(1)}).loose();A({currentVersion:E().min(1),targets:qa(E(),Fre.nullable())}).loose();var Ire=`server-info`,Lre=`branch-switched`,Rre=`disk-ack`,zre=`config-validation-rejected`,Bre=`config-ignore-nested-error`,E9=j([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Vre=A({v:M(1),ch:M(Ire),seq:D(),serverInstanceId:E().min(1),currentBranch:E().min(1).optional()}).loose(),Hre=A({v:M(1),ch:M(Lre),seq:D(),branch:E().min(1)}).loose(),Ure=A({v:M(1),ch:E9,seq:D()}).loose(),Wre=A({v:M(1),ch:M(Rre),seq:D(),docName:E().min(1),sv:E().min(1)}).loose(),Gre=A({v:M(1),ch:M(zre),seq:D(),docName:E().min(1),error:wu}).loose(),Kre=A({v:M(1),ch:M(Bre),seq:D(),path:E().min(1),error:E().min(1)}).loose(),qre={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function Jre(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var Yre=/\.(?:md|mdx)$/;function Xre(e,t){if(t!==`page`)return e;let n=e.replace(Yre,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zre(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=KZ({schema:qre});return e.length>0&&rQ(t,e),t}function Qre(e){let t={documents:e};return D9.set(t,A9(e)),t}function $re(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function eie(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function tie(e,t){let n=O9(t);if(!n)return 0;let r=Xre(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var nie=.5;function M9(e,t){let n=tie(e,t);return n<=0?n:l4(e.path)?n*nie:n}var rie=60;function iie(e){return e===`file`?-rie:0}var aie=1e3,N9=50,oie=1,sie=1,cie=.001;function lie(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-cie:0,c=oie*a+sie*o+s;return e*aie+c}function P9(e,t,n,r){return e+t*20+n+iie(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):lie(t,n,r,i,a)}function uie(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function die(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function fie(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function pie(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function mie(e,t){return O9(t).length<4?0:+(e===`full_text`)}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=[],i=0,a=0;for(let t of e){if(t.document.kind===`folder`){if(i>=3)continue;i+=1}else if(t.document.kind===`file`){if(a>=3)continue;a+=1}if(r.push(t),r.length>=n)break}return r}function hie(e,t,n={}){let r=n.intent??`omnibar`,i=uie(r,n.ranking),a=Jre(n.limit),o=new Set(n.scopes??eie(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=NQ($re(e),{term:c,properties:fie(r),boost:pie(r),tolerance:mie(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=die(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(gie({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function gie(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function _ie(e){return`https://github.com/${e.owner}/${e.repo}.git`}function vie(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=mr());var V9=B9[z9],H9=za({version:E().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:Ji().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:j([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()});za({schema:M(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:za({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function yie(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??bie,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function bie(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function xie(){let e=!1,t=``,n=0;return r=>{let i=Sie(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Sie(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}function Cie(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function wie(e){if(typeof e!=`string`||e.length===0)return e;let t=Q3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(q3(e)){let t=Cie(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=W3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var Tie=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Eie={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Die={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Oie(e,t=Tie){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function kie(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Aie(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var jie={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Mie(e){return e?jie[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Nie(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Pie(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Fie(e){let[t]=Nie(e);return Pie(t,45,32)}var Iie=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Lie=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Rie(){return`${q9(Iie)} ${q9(Lie)}`}function zie(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Bie(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Rie(),Y9(G9,n)),r||(r=zie(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Vie(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Hie(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Uie(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Vie(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Wie(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Gie(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function Kie(e,t,n=null){let r=Q9(e);r.pop();let i=Q9(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function qie(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function Jie(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{rre as $,d$ as $n,F as $r,xie as $t,C9 as A,qQ as An,Ob as Ar,W$ as At,W9 as B,_9 as Bn,av as Br,Uie as Bt,gre as C,B6 as Cn,TS as Cr,H1 as Ct,D1 as D,M6 as Dn,gb as Dr,nre as Dt,J1 as E,F6 as En,nb as Er,S2 as Et,p1 as F,P1 as Fn,hb as Fr,A2 as Ft,C0 as G,h0 as Gn,Vp as Gr,g0 as Gt,ire as H,F3 as Hn,wp as Hr,Y$ as Ht,$Q as I,A0 as In,Xb as Ir,Kie as It,P0 as J,W3 as Jn,L as Jr,z2 as Jt,w0 as K,W7 as Kn,I as Kr,Oie as Kt,E2 as L,k0 as Ln,xS as Lr,_ie as Lt,_re as M,$9 as Mn,uS as Mr,s4 as Mt,A1 as N,XQ as Nn,zy as Nr,D2 as Nt,Cre as O,L6 as On,Tb as Or,Hie as Ot,G1 as P,G3 as Pn,Dy as Pr,O2 as Pt,N1 as Q,Q3 as Qn,od as Qr,kie as Qt,w2 as R,T2 as Rn,iS as Rr,yie as Rt,u0 as S,P6 as Sn,qb as Sr,M4 as St,Y1 as T,z6 as Tn,lS as Tr,y2 as Tt,V1 as U,l0 as Un,R as Ur,X$ as Ut,j3 as V,Vne as Vn,zv as Vr,Wie as Vt,l7 as W,l1 as Wn,Rp as Wr,C1 as Wt,mne as X,I4 as Xn,Zd as Xr,R2 as Xt,Qne as Y,qie as Yn,gf as Yr,L2 as Yt,W0 as Z,_2 as Zn,P as Zr,a4 as Zt,_1 as _,P3 as _n,YT as _r,b4 as _t,W1 as a,M as ai,m1 as an,C2 as ar,j4 as at,w1 as b,H6 as bn,tS as br,Mre as bt,qne as c,g as ci,zQ as cn,o9 as cr,BQ as ct,Gre as d,Aie as dn,I2 as dr,E0 as dt,ou as ei,D6 as en,u$ as er,F1 as et,Ure as f,ZQ as fn,k9 as fr,O0 as ft,b1 as g,h1 as gn,vT as gr,x4 as gt,q$ as h,v2 as hn,IT as hr,g4 as ht,k1 as i,du as ii,M1 as in,hie as ir,A4 as it,Gne as j,O1 as jn,Jb as jr,c1 as jt,E9 as k,R6 as kn,Db as kr,n1 as kt,Hre as l,h as li,_0 as ln,L4 as lr,G0 as lt,Vre as m,Bie as mn,_te as mr,k4 as mt,Die as n,Ou as ni,Zre as nn,wie as nr,bre as nt,ure as o,A as oi,b2 as on,e$ as or,P4 as ot,Wre as p,Ene as pn,xte as pr,g1 as pt,E1 as q,g2 as qn,yp as qr,B2 as qt,L1 as r,Tu as ri,Fie as rn,Jie as rr,vre as rt,dre as s,E as si,Z9 as sn,S0 as sr,N4 as st,Eie as t,$l as ti,Qre as tn,Gie as tr,I1 as tt,Kre as u,t9 as un,s9 as ur,Sre as ut,y1 as v,Mie as vn,tE as vr,w4 as vt,hre as w,I6 as wn,SS as wr,X1 as wt,U9 as x,N6 as xn,Bx as xr,wre as xt,v1 as y,V6 as yn,KT as yr,d2 as yt,Yne as z,q3 as zn,nv as zr,vie as zt};
511
+ `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function une(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&lne(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=cne(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Q7(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=e,a=i.charCodeAt(0);$7(t.before.charCodeAt(t.before.length-1),a,r)&&(i=e9(a)+i.slice(1));let o=i.charCodeAt(i.length-1);return $7(t.after.charCodeAt(0),o,r)&&(i=i.slice(0,-1)+e9(o)),i}function $7(e,t,n){return!(sz(t)!==X7||n===`_`&&sz(e)===void 0)}function e9(e){return`&#x${e.toString(16).toUpperCase()};`}function dne(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!pne(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function fne(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),s+=a.move(i),o(),s}function pne(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function t9(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var mne=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Tb(e.extensions),this.handlers=bne(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=xne(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Gte({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=Kte({toMarkdownHandlers:rne})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return Jte(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Yte(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?X6(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return Xte(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},n9=D6();function hne(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function gne(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function _ne(e){return e.attrs.sourceDirty||gne(e)}function vne(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function r9(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function i9(e,t){if(e.length===0)return r9({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return r9({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[i9(n.children,t)]}}return r9({type:`inlineCode`,value:a9(e)},t)}function a9(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=a9(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var yne=V1;function bne(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=XU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=XU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=W7(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&r2(t.raw)!==null&&e2(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=r2(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=ZU(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=ZU(r.highlight)),r.comment&&(i.comment=ZU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=XU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=ZU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=ZU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=XU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=XU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=XU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=n9.getOrWildcard(o),c=hne(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=W7(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=b2(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&yne.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&H1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&W1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&G1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:t9(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=XU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function xne(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=nW(`paragraph`)),r.blockquote&&(t.blockquote=nW(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=nW(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=nW(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&vne(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),r.tableRow&&(t.tableRow=nW(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=nW(`tableCell`,a)),r.tableHeader&&(t.tableHeader=nW(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!_ne(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:n9.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:n9,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=rW(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=rW(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return i9(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=rW(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return i.highlight&&(n.highlight=rW(`mark`)),i.comment&&(n.comment=rW(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=nW(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=nW(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return a2(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var Sne=/\p{M}+/gu,Cne=/[^\p{L}\p{N}]+/gu,wne=/^-+|-+$/g;function o9(e){return e.trim().normalize(`NFKD`).replace(Sne,``).toLowerCase().replace(Cne,`-`).replace(wne,``)}function Tne(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function Ene(e,t){let n=o9(e);return n?Tne(n,t):``}function s9(e,t){let n=o9(e);return t?`#${n}-${o9(t)}`:`#${n}`}var c9=new Set([`img`,`video`,`audio`,`mark`]),Dne=new Map(T6.flatMap(e=>e.surface===`compat`&&c9.has(e.rendersAs)?[[e.name,e]]:[]));function l9(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function u9(e){let t=e.name;if(!t||!c9.has(t))return null;let n=l9(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function d9(e){let t=e.name;if(!t)return null;let n=Dne.get(t);if(!n)return null;let r=l9(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var One=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},kne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Ane=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},jne=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Mne=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Nne=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function f9(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(f9).join(``):``}var p9={wikiLink:One,wikiLinkEmbed:kne,mdxJsxFlowElement:Ane,mdxJsxTextElement:jne,rawMdxFallback:Mne,mark:Nne,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Pne=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Fne=/\bexpression\s*\(/i,Ine=1e4;function Lne(e){return!(e.length>Ine||Pne.test(e)||Fne.test(e))}function m9(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!k0(e.split(/\s+/)[0]??``))return!1}return!0}var Rne={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},zne=new Set([`href`,`src`]),Bne=cV(`<>`),h9=()=>e=>{IF(e,`element`,e=>{let t=Rne[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?U8(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(zne.has(e))if(t===`<>`||t===Bne)r=``;else{let e=U8(t);r=e===t?t:cV(e)}else r=U8(t);r!==t&&(n[e]=r)}})},g9=()=>e=>{IF(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!k0(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!k0(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!k0(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!m9(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!m9(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!k0(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Lne(r)&&delete n.style})};function Vne(e){let t=DU().use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ),n=t.runSync(e);return String(t.stringify(n))}function _9(e){let t=DU().use(TG).use(wW,[`yaml`]).use(w7).use(vU).use(R7).use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ);return String(t.processSync(e))}fq(),TK(),EK(),A({docName:d4,summary:p4,content:E().optional(),...f4}).loose(),A({docName:d4,summary:p4,markdown:E(),position:j([`append`,`prepend`,`replace`]).optional(),extension:j(T1).optional(),...f4}).loose(),A({docName:d4,summary:p4,find:E().min(1),replace:E(),offset:D().int().nonnegative().optional(),...f4}).loose(),A({docName:d4,connectionId:E().min(1),scope:j([`last`,`session`,`file`]).optional(),...f4}).loose();var v9=A({value:E(),truncatedFrom:D().int().nonnegative().optional(),hint:E().optional()}).loose(),Hne=Ua(`kind`,[A({kind:M(`inline`),content:E()}),A({kind:M(`truncated`),byteLength:D().int().nonnegative(),hint:E()})]),y9=A({kind:M(`content-divergence`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),divergenceType:E().optional(),currentState:Hne.optional(),hint:E().optional()}).loose(),Une=A({type:M(`orphan`),parentCandidates:k(E()),message:E()}).loose(),b9=A({kind:M(`disk-edit-reconciled`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),mergeOutcome:E().optional(),hint:E().optional()}).loose(),x9=Ua(`kind`,[y9,b9]),S9=k(Ua(`kind`,[y9,b9,A({kind:M(`mermaid-parse-error`),fenceIndex:D().int().positive(),fenceFirstLine:E(),message:E(),line:D().int().positive().optional()}).loose()])).min(1);A({timestamp:E().min(1),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),hints:k(Une).optional(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({docName:E().min(1),scope:j([`last`,`session`]),undone:O()}).loose(),A({docName:d4,patch:qa(E(),Va([WQ,Ma()])),types:qa(E(),j(VQ)).optional(),summary:p4,...f4}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),appliedKeys:k(E()),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({entries:k(A({level:j([`info`,`warn`,`error`]),message:E().max(N4),event:E().optional(),fields:qa(E(),Pa()).optional(),ts:D().optional(),sourceId:E().optional(),lineNumber:D().optional()}).loose()).max(100)}).loose(),A({accepted:D().int().min(0)}).loose();var Wne=A({status:E().min(1),reason:E()}).loose();A({docName:E().min(1),content:E(),lifecycle:Wne.nullable()}).loose();var C9=A({kind:j([`document`,`asset`,`folder`,`file`]).default(`document`),docName:E().min(1).optional(),docExt:E().min(1).default(`.md`),size:D().int().nonnegative(),modified:E().min(1),isSymlink:O().default(!1),canonicalDocName:E().nullable().default(null),targetPath:E().nullable().default(null),path:E().min(1).optional(),assetExt:E().min(1).optional(),mediaKind:j([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:k(E().min(1)).optional(),hasChildren:O().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Gne=A({documents:k(C9),truncated:O().optional()}).loose(),Kne=A({source:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),qne=A({docName:E().min(1),backlinks:k(Kne)}).loose();A({counts:qa(E().min(1),D().int().nonnegative())}).loose();var Jne=Ua(`kind`,[A({kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),A({kind:M(`external`),url:E().min(1),title:E(),snippet:E().nullable()}).loose()]),Yne=A({docName:E().min(1),forwardLinks:k(Jne)}).loose(),Xne=Ua(`kind`,[A({id:E().min(1),kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),label:E(),cluster:E().nullable(),category:E().nullable(),tags:k(E()).nullable()}).loose(),A({id:E().min(1),kind:M(`external`),url:E().min(1),label:E()}).loose()]),Zne=A({source:E().min(1),target:E().min(1)}).loose(),Qne=A({nodes:k(Xne),links:k(Zne)}).loose(),$ne=A({ts:D().int().min(0),url:E(),method:E(),ua:E().optional(),origin:E().optional(),referer:E().optional(),host:E().optional(),remote:E().optional(),secChUa:E().optional(),secChUaMobile:E().optional(),secChUaPlatform:E().optional(),secFetchSite:E().optional(),secFetchDest:E().optional(),secFetchMode:E().optional(),secFetchUser:E().optional()}).loose(),ere=A({app:Va([M(`cursor`),M(`codex`),M(`claude`),Ma()]),signals_fired:k(E())}).loose();A({entries:k($ne),count:D().int().min(0),detection:ere}).loose(),A({writers:k(A({id:E().min(1),name:E().optional(),email:E().optional()}).loose()).optional(),summary:p4,...f4}).loose(),A({checkpointRef:E().min(1)}).loose();var tre=A({v:D().int().optional(),id:E().min(1),name:E().min(1),colorSeed:E().optional(),docs:k(E()),summaries:k(E()).optional()}).loose();A({entries:k(A({sha:E().min(1),timestamp:E().min(1),author:E(),authorEmail:E(),type:j([`checkpoint`,`wip`,`upstream`,`park`]),message:E(),contributors:k(tre),checkpoint:Pa().nullable()}).loose()),total:D().int().nonnegative().optional(),truncated:O().optional(),hasMore:O().optional()}).loose(),A({sha:E().regex(/^[0-9a-f]{40}$/i),content:E(),timestamp:E(),author:E()}).loose();var nre=A({contentDir:E().min(1),pathSeparator:j([`/`,`\\`]),symlinkResolved:O()}).loose();k(Ua(`source`,[A({docName:E().min(1),timestamp:E().min(1),size:D().int().nonnegative(),source:M(`flat`)}).loose(),A({docName:E().min(1),timestamp:E().min(1),source:M(`timeline`),sha:E().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var rre=A({orphans:k(A({docName:E().min(1),title:E()}).loose())}).loose(),ire=A({hubs:k(A({docName:E().min(1),title:E(),count:D().int().nonnegative()}).loose())}).loose(),are=A({source:E().min(1),title:E(),snippet:E().nullable()}).loose();A({deadLinks:k(A({target:E().min(1),sources:k(are)}).loose())}).loose(),A({target:A({docName:E().min(1),title:E(),aliases:k(E())}).loose(),mentions:k(A({source:E().min(1),excerpt:E(),offset:D().int().nonnegative()}).loose()),truncated:O()}).loose(),A({projectPath:E().min(1)}).loose();var ore=j([`not-a-git-worktree`,`init-failed`]);Ua(`ok`,[A({ok:M(!0),projectPath:E().min(1)}).loose(),A({ok:M(!1),reason:ore,message:E().min(1)}).loose()]),A({host:E().min(1).optional()}).loose(),A({key:E().min(1)}).loose(),A({keyPresent:O()}).loose(),A({name:E().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:E().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),A({authenticated:O()}).loose(),A({}).loose();var sre=A({stackIndex:D().int().min(0),ts:D().int().min(0),additions:D().int().min(0),deletions:D().int().min(0)}).loose(),cre=A({docName:E().min(1),additionsTotal:D().int().min(0),deletionsTotal:D().int().min(0),lastTs:D().int().min(0),bursts:k(sre)}).loose(),lre=A({displayName:E().min(1),color:E().min(1),icon:E().optional(),connectionId:E().min(1)}).loose(),ure=A({sessionAlive:O(),agent:lre.nullable(),files:k(cre)}).loose(),dre=A({diff:E(),generatedAt:D().int().min(0)}).loose();A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose();var fre=A({displayName:E().min(1),icon:E(),color:E().min(1),currentDoc:E().nullable(),mode:j([`idle`,`writing`]),ts:D().int().min(0)}).loose();A({presence:qa(E().min(1),fre)}).loose(),qa(E().min(1),O()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),A({path:E().min(1,`path must be non-empty`)}).loose(),A({}).loose();var pre=A({fromDocName:E().min(1),toDocName:E().min(1)}).loose(),mre=A({fromPath:E().min(1),toPath:E().min(1)}).loose();A({}).loose(),A({path:E().min(1),...f4,summary:p4}).loose();var hre=A({docName:E().min(1)}).loose();A({path:E().min(1),...f4,summary:p4}).loose();var gre=A({path:E().min(1)}).loose();A({kind:j([`file`,`folder`]),path:E().min(1),...f4,summary:p4}).loose();var _re=A({kind:j([`file`,`folder`]),path:E().min(1),duplicatedDocNames:k(E().min(1))}).loose(),vre=A({pages:k(A({docName:E().min(1),title:E(),docExt:E().min(1),size:D().int().nonnegative(),modified:E().min(1),icon:E().min(1).max(2048).optional()}).loose())}).loose(),yre=A({level:D().int().min(1).max(6),text:E(),slug:E()}).loose(),bre=A({docName:E().min(1),headings:k(yre)}).loose(),xre=A({docName:E().min(1),rewrites:D().int().nonnegative()}).loose();A({kind:j([`file`,`folder`,`asset`]),fromPath:E().min(1),toPath:E().min(1),...f4,summary:p4}).loose();var Sre=A({renamed:k(pre),renamedAssets:k(mre),rewrittenDocs:k(xre).optional(),summary:v9.optional()}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4}).loose();var Cre=A({deletedDocNames:k(E().min(1))}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4,summary:p4}).loose();var wre=A({deletedDocNames:k(E().min(1))}).loose();A({docName:E().min(1),commitSha:E().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:p4,...f4}).loose(),A({restoredFrom:E().min(1),timestamp:E().min(1),summary:v9.optional(),warning:y9.optional(),warnings:S9.optional()}).loose();var Tre=j([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Ere=A({label:E().min(1),webUrl:da().nullable()}).loose(),Dre=Ua(`checkStatus`,[A({checkStatus:M(`allowed`)}).loose(),A({checkStatus:M(`denied`),deniedReason:j([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),A({checkStatus:M(`unknown`),unknownError:j([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),w9=j([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);A({state:Tre,lastSyncUtc:E().nullable(),lastFetchUtc:E().nullable(),lastPushedSha:E().nullable(),ahead:D().int().min(0),behind:D().int().min(0),consecutiveFailures:D().int().min(0),conflictCount:D().int().min(0),hasRemote:O(),syncEnabled:O(),identityUnresolved:O(),remote:Ere.nullable().optional(),pushError:E().optional(),pushErrorCode:w9.optional(),pullError:E().optional(),pullErrorCode:w9.optional(),pausedReason:E().optional(),pushPermission:Dre.optional()}).loose(),A({op:j([`sync`,`push`,`pull`]).optional()}).loose(),A({op:j([`sync`,`push`,`pull`])}).loose(),A({conflicts:k(A({file:E().min(1),detectedAt:E().min(1),oursSha:E().optional(),theirsSha:E().optional(),baseSha:E().optional()}).loose())}).loose(),A({file:E().min(1),strategy:j([`mine`,`theirs`,`content`,`delete`]),content:E().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),A({}).loose(),A({file:E().min(1),base:E(),ours:E(),theirs:E(),kind:j([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:E().nullable()}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({result:go(e=>e!==void 0,{message:`result is required`})}).loose();var Ore=A({path:E().min(1),summary:E().min(1)}).loose(),kre=A({files:D().int().nonnegative(),folders:D().int().nonnegative()}).loose();A({packs:k(A({id:E().min(1),name:E().min(1),description:E().min(1),defaultSubfolder:E().optional(),folders:k(Ore),entryCounts:kre}).loose())}).loose(),A({noOpen:O().optional(),out:E().min(1).optional()}).loose();var Are=A({reason:j([`unsupported-platform`,`spawn-error`]),message:E()}).loose();Ua(`status`,[A({status:M(`installed`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E()}).loose(),A({status:M(`built`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E(),handoffError:Are.optional()}).loose(),A({status:M(`failed`),buildError:E()}).loose(),A({status:M(`skip-current`),skillVersion:E(),recordedAt:E().optional()}).loose()]),A({tags:k(A({name:E().min(1),count:D().int().nonnegative(),isLeaf:O()}).loose())}).loose();var jre=A({docName:E().min(1),title:E(),matchingTags:k(E().min(1)),snippet:E().nullable()}).loose();A({name:E().min(1),docs:k(jre)}).loose(),A({folder:Pa(),frontmatter_local:qa(E(),Pa()).nullable()}).loose(),A({path:E(),frontmatter:qa(E(),Pa()).optional()}).loose(),A({applied:Pa()}).loose();var T9=qa(E(),Pa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});A({template:A({name:E().min(1),folder:E(),scope:j([`local`,`inherited`]),path:E().min(1),frontmatter:T9,body:E()}).strict()}).strict();var Mre=A({templates:k(A({name:E().min(1),title:E().optional(),description:E().optional(),path:E().min(1),source_folder:E()}).strict()),truncated:O()}).strict();A({folder:E(),name:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({path:E().min(1),created:O(),warnings:k(E())}).strict(),A({existed:O(),path:E().min(1)}).strict(),A({fromFolder:E(),fromName:E(),toFolder:E(),toName:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({from:E().min(1),to:E().min(1),committed:O()}).strict(),A({query:E().optional(),intent:j([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:j([`navigation`,`relevance`]).optional(),scopes:k(j([`page`,`folder`,`content`,`file`])).optional(),scope:E().optional(),limit:D().int().nonnegative().optional(),semantic:O().optional(),source:j([`omnibar`,`mcp`,`http`]).optional()}).loose();var Nre=A({kind:j([`page`,`folder`,`content`,`file`]),path:E().min(1),title:E(),score:D(),signals:qa(E(),Pa()),snippet:E().optional()}).loose(),Pre=A({capable:O(),applied:O(),coverage:A({embedded:D().int().nonnegative(),total:D().int().nonnegative()})}).loose();A({enabled:O(),keyPresent:O(),keySource:j([`file`,`env`]).nullable(),keyHint:E().nullable(),ready:O(),capable:O(),embedded:D().int().nonnegative(),total:D().int().nonnegative()}).loose(),A({query:E(),intent:j([`autocomplete`,`full_text`,`omnibar`]),results:k(Nre),elapsedMs:D().nonnegative(),semantic:Pre.optional(),truncated:O().optional(),ready:O().optional()}).loose();var Fre=A({version:E().min(1),recordedAt:E().min(1)}).loose();A({currentVersion:E().min(1),targets:qa(E(),Fre.nullable())}).loose();var Ire=`server-info`,Lre=`branch-switched`,Rre=`disk-ack`,zre=`config-validation-rejected`,Bre=`config-ignore-nested-error`,E9=j([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Vre=A({v:M(1),ch:M(Ire),seq:D(),serverInstanceId:E().min(1),currentBranch:E().min(1).optional()}).loose(),Hre=A({v:M(1),ch:M(Lre),seq:D(),branch:E().min(1)}).loose(),Ure=A({v:M(1),ch:E9,seq:D()}).loose(),Wre=A({v:M(1),ch:M(Rre),seq:D(),docName:E().min(1),sv:E().min(1)}).loose(),Gre=A({v:M(1),ch:M(zre),seq:D(),docName:E().min(1),error:wu}).loose(),Kre=A({v:M(1),ch:M(Bre),seq:D(),path:E().min(1),error:E().min(1)}).loose(),qre={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function Jre(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var Yre=/\.(?:md|mdx)$/;function Xre(e,t){if(t!==`page`)return e;let n=e.replace(Yre,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zre(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=KZ({schema:qre});return e.length>0&&rQ(t,e),t}function Qre(e){let t={documents:e};return D9.set(t,A9(e)),t}function $re(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function eie(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function tie(e,t){let n=O9(t);if(!n)return 0;let r=Xre(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var nie=.5;function M9(e,t){let n=tie(e,t);return n<=0?n:l4(e.path)?n*nie:n}var rie=60;function iie(e){return e===`file`?-rie:0}var aie=1e3,N9=50,oie=1,sie=1,cie=.001;function lie(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-cie:0,c=oie*a+sie*o+s;return e*aie+c}function P9(e,t,n,r){return e+t*20+n+iie(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):lie(t,n,r,i,a)}function uie(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function die(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function fie(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function pie(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function mie(e,t){return O9(t).length<4?0:+(e===`full_text`)}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=[],i=0,a=0;for(let t of e){if(t.document.kind===`folder`){if(i>=3)continue;i+=1}else if(t.document.kind===`file`){if(a>=3)continue;a+=1}if(r.push(t),r.length>=n)break}return r}function hie(e,t,n={}){let r=n.intent??`omnibar`,i=uie(r,n.ranking),a=Jre(n.limit),o=new Set(n.scopes??eie(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=NQ($re(e),{term:c,properties:fie(r),boost:pie(r),tolerance:mie(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=die(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(gie({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function gie(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function _ie(e){return`https://github.com/${e.owner}/${e.repo}.git`}function vie(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=mr());var V9=B9[z9],H9=za({version:E().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:Ji().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:j([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()});za({schema:M(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:za({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function yie(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??bie,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function bie(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function xie(){let e=!1,t=``,n=0;return r=>{let i=Sie(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Sie(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}function Cie(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function wie(e){if(typeof e!=`string`||e.length===0)return e;let t=Q3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(q3(e)){let t=Cie(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=W3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var Tie=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Eie={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Die={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Oie(e,t=Tie){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function kie(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Aie(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var jie={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Mie(e){return e?jie[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Nie(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Pie(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Fie(e){let[t]=Nie(e);return Pie(t,45,32)}var Iie=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Lie=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Rie(){return`${q9(Iie)} ${q9(Lie)}`}function zie(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Bie(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Rie(),Y9(G9,n)),r||(r=zie(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Vie(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Hie(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Uie(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Vie(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Wie(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Gie(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function Kie(e,t,n=null){let r=Q9(e);r.pop();let i=Q9(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function qie(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function Jie(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{rre as $,d$ as $n,F as $r,xie as $t,C9 as A,qQ as An,Ob as Ar,W$ as At,W9 as B,_9 as Bn,av as Br,Uie as Bt,gre as C,B6 as Cn,TS as Cr,H1 as Ct,D1 as D,M6 as Dn,gb as Dr,nre as Dt,J1 as E,F6 as En,nb as Er,S2 as Et,p1 as F,P1 as Fn,hb as Fr,A2 as Ft,C0 as G,h0 as Gn,Vp as Gr,g0 as Gt,ire as H,F3 as Hn,wp as Hr,Y$ as Ht,$Q as I,A0 as In,Xb as Ir,Kie as It,P0 as J,W3 as Jn,L as Jr,z2 as Jt,w0 as K,W7 as Kn,I as Kr,Oie as Kt,E2 as L,k0 as Ln,xS as Lr,_ie as Lt,_re as M,$9 as Mn,uS as Mr,s4 as Mt,A1 as N,XQ as Nn,zy as Nr,D2 as Nt,Cre as O,L6 as On,Tb as Or,Hie as Ot,G1 as P,G3 as Pn,Dy as Pr,O2 as Pt,N1 as Q,Q3 as Qn,od as Qr,kie as Qt,w2 as R,T2 as Rn,iS as Rr,yie as Rt,u0 as S,P6 as Sn,qb as Sr,M4 as St,Y1 as T,z6 as Tn,lS as Tr,y2 as Tt,V1 as U,l0 as Un,R as Ur,X$ as Ut,j3 as V,Vne as Vn,zv as Vr,Wie as Vt,l7 as W,l1 as Wn,Rp as Wr,C1 as Wt,mne as X,I4 as Xn,Zd as Xr,R2 as Xt,Qne as Y,qie as Yn,gf as Yr,L2 as Yt,W0 as Z,_2 as Zn,P as Zr,a4 as Zt,_1 as _,P3 as _n,YT as _r,b4 as _t,W1 as a,M as ai,m1 as an,C2 as ar,j4 as at,w1 as b,H6 as bn,tS as br,Mre as bt,qne as c,g as ci,zQ as cn,o9 as cr,BQ as ct,Gre as d,Aie as dn,I2 as dr,E0 as dt,ou as ei,D6 as en,u$ as er,F1 as et,Ure as f,ZQ as fn,k9 as fr,O0 as ft,b1 as g,h1 as gn,vT as gr,x4 as gt,q$ as h,v2 as hn,IT as hr,g4 as ht,k1 as i,du as ii,M1 as in,hie as ir,A4 as it,Gne as j,O1 as jn,Jb as jr,c1 as jt,E9 as k,R6 as kn,Db as kr,n1 as kt,Hre as l,h as li,_0 as ln,L4 as lr,G0 as lt,Vre as m,Bie as mn,_te as mr,k4 as mt,Die as n,Ou as ni,Zre as nn,wie as nr,bre as nt,ure as o,A as oi,b2 as on,e$ as or,P4 as ot,Wre as p,Ene as pn,xte as pr,g1 as pt,E1 as q,g2 as qn,yp as qr,B2 as qt,L1 as r,Tu as ri,Fie as rn,Jie as rr,vre as rt,dre as s,E as si,Z9 as sn,S0 as sr,N4 as st,Eie as t,$l as ti,Qre as tn,Gie as tr,I1 as tt,Kre as u,t9 as un,s9 as ur,Sre as ut,y1 as v,Mie as vn,tE as vr,w4 as vt,hre as w,I6 as wn,SS as wr,X1 as wt,U9 as x,N6 as xn,Bx as xr,wre as xt,v1 as y,V6 as yn,KT as yr,d2 as yt,Yne as z,q3 as zn,nv as zr,vie as zt};